* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
require_once '../src/QueryPath/QueryPath.php';
// The URL of the remote RSS feed.
$remote = 'http://querypath.org/aggregator/rss/2/rss.xml';
// We will write the results into this document.
$out = qp(QueryPath::HTML_STUB, 'title')
->text('RSS Titles')
->top()
->find('body')
->append('
')
->children('ul');
// Load the remote document and loop through all of the items.
foreach (qp($remote, 'channel>item') as $item) {
// Get title and link.
$title = $item->find('title')->text();
$link = $item->next('link')->text();
// Do a little string building.
$bullet = '' . $title . '';
// Add it to the output document.
$out->append($bullet);
}
// Write the results.
$out->writeHTML();