View Single Post
Old 12-05-2012, 07:48 PM   PM User | #1
javanewbie7
Regular Coder

 
Join Date: Oct 2010
Posts: 121
Thanks: 25
Thanked 0 Times in 0 Posts
javanewbie7 is an unknown quantity at this point
Probably a dumb question about posting RSS Feed info on Website with PHP

I'm trying to take two separate blogs from wordpress and one from blogger and post the latest blog on my website. Actually, not the full blog, just the title, maybe 100 characters and then continue reading with a url to the post.

Anyway, I believe I have the correct PHP to do this and I've read online that magpie is a good RSS parser to use. My question is, what do I do with the file I dl from MagPie? I mean, do I place the file on my server or ??

The file I dl is called something like magpierss-0.72.tar.gz

Just in case it's needed, here's the code that I came up with the help of the MagPie Website

Code:
<?php  
require_once 'rss_fetch.inc';

$url = 'http://straight2jackie.blogspot.com/feeds/posts/default?alt=rss';
$rss = fetch_rss($url);

echo "Site: ", $rss->channel['title'], "<br>";
foreach ($rss->items as $item ) {
    $title = $item[title];
    $url   = $item[link];
    echo "<a href=$url>$title</a></li><br>";
}

?>
thanks.
javanewbie7 is offline   Reply With Quote