function space_seperated_tokens($string)
{
$space_characters = " \t\n\v\f\r";
$string_length = strlen($string);
$position = strspn($string, $space_characters);
$tokens = array();
while ($position < $string_length) {
$len = strcspn($string, $space_characters, $position);
$tokens[] = substr($string, $position, $len);
$position += $len;
$position += strspn($string, $space_characters, $position);
}
return $tokens;
}
function result() { if ($this->data['file']->url != 'http://diveintomark.org/tests/client/autodiscovery/') { parent::result(); } static $done = array(); $links = SimplePie_Misc::get_element('link', $this->data['file']->body); foreach ($links as $link) { if (!empty($link['attribs']['href']['data']) && !empty($link['attribs']['rel']['data'])) { $rel = array_unique(SimplePie_Misc::space_seperated_tokens(strtolower($link['attribs']['rel']['data']))); $href = SimplePie_Misc::absolutize_url(trim($link['attribs']['href']['data']), $this->data['file']->url); if (!in_array($href, $done) && in_array('next', $rel)) { $done[] = $this->data['url'] = $href; break; } } } if ($this->data['url']) { $this->run(); } }