»  Home  »  Web Technologies  »  Syndicating Content with RSS and ArticleLive
 »  Home  »  Programming  »  Syndicating Content with RSS and ArticleLive
 »  Home  »  ArticleLive  »  Syndicating Content with RSS and ArticleLive
Syndicating Content with RSS and ArticleLive
By Jordie Bodlay | Published 07/19/2006 | Web Technologies , Programming , ArticleLive | Rating: ratingfullratingfullratingfullratingfullratingempty Unrated |
Using RSS Feeds

So, you have an RSS feed link, but what can you do with it? The most common use is to add it to an RSS reader program such as Google Reader, FeedReader, Awasu and their popular online cousin BlogLines.com. Yahoo, MSN and Google also allow you to input feed URL's for your own customized homepage with news stories and articles from websites of your own choosing.

But what if you are a webmaster and want to display a feed from another site on your own web site, or give instructions for how other webmasters can do the same using your feed? One answer is Magpie RSS. This amazing open source PHP application can be up and running in just a few minutes and can save you a lot of hassle if you're considering building your own RSS parser. Magpie RSS is available for download from Sourceforge.

Once downloaded, all you need to do is place the program in a sub folder on your web site (purely to be tidy, it can be placed anywhere). Then run a simple bit of PHP code on your web page:

<?php

include_once('magpierss/rss_fetch.inc');
$rss = fetch_rss("http://www.interspire.com/content/articlerss.php");
echo "<h3>" . $rss->channel['title'] . "</h3><p>";
echo "<ul>";
foreach ($rss->items as $item) {
            $href = $item['link'];
            $title = $item['title'];
            echo '<li><a href="'.$href.'">'.$title.'</a></li>';
}
echo "</ul>";
?>

The above example grabs our article RSS feed and formats it into a bullet point list. You can copy and paste that code, change the URL to another feed and it will work straight away.

Web designers: Learn how to attract more clients and profit like the big guys. Subscribe to our newsletter.