Extract Recent Url’s From RSS FEED of a blog
It would be very useful if we could extract the url of the posts of a blog from RSS FEED.Almost all the sites have rss feeds and we could directly get the link to those posts by extracting via php.We can thus show the recent posts too to the viewers easily from the homepage itself.
Here,we have a variable ‘total’ which gives the number of links to be extracted from the rss feed.You can vary the value according to your need.
Change the url field in the code to the url of rss feed of the required site.
<?php
$url = "http://www.techtipsmaster.com/feed/rss";
$file = file_get_contents($url);
$xml = new SimpleXmlElement($file);
$total =5;
$counter = 0;
foreach ($xml->channel->item as $entry) {
if(++$counter > $total) break;
echo "<p><a href='$entry->link' title='$entry->title'>" . $entry->title . "</p>";
}
?>






Very nice information. Thanks for this. Hope you visit my site and post up some stuff