JavaScript Editor Ajax software     Free javascripts 



Main Page

// add a feed item and its contents
echo ‘<item>’;
foreach ($feed_item as $item_name => $item_value)
{
echo “<$item_name>” .
RSSFactory::_escapeXML($item_value) .
“</$item_name>”;
}
echo ‘</item>’;
}
// close channel and rss elements
echo ‘</channel></rss>’;
// return feed data
return ob_get_clean();
}
}
?>
2.
Create a new file in your
seophp
folder named
feed.php
, and type this code in it:
<?php
// load the URL factory library
require_once ‘include/rss_factory.inc.php’;
// create feed
$rss_feed = new RSSFactory(‘SEOEgghead.com New Products Feed’,
‘http://www.seoegghead.com/seo-with-php-updates.html’,
‘Exciting new products, updated daily’);
// add feed item
$rss_feed->addItem(‘New Link Juice with Orange Flavor!’,
‘http://seophp.example.com/Products/SEO-Toolbox-C6/Link-Juice-P31.html’,
‘The new Link Juice product of SEOEgghead.com can do wonders for your website!’);
// add feed item
$rss_feed->addItem(‘Enhance Your PHP Applications with AJAX!’,
‘http://seophp.example.com/Products/Friends-Shed-C2/AJAX-PHP-Book-P42.html’,
‘Check out this AJAX tutorial for PHP developers!’);
// display feed
echo $rss_feed->get();
?>
3.
Load
http://seophp.example.com/feed.php
. A modern web browser will ask if you want
to subscribe to this feed, as shown in Figure 7-2.
156
Chapter 7: Web Feeds and Social Bookmarking
c07.qxd:c07 10:42 156


JavaScript Editor Ajax software     Free javascripts