ClioSport.net

Register a free account today to become a member!
Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • When you purchase through links on our site, we may earn an affiliate commission. Read more here.

Magpie RSS - Help?



Am trying to embed an RSS feed into a webpage and using this code (below) and Magpie RSS, but I am might be being a little thick, but for the life of me I cant owrk out how to point to the original feed. Help much appreciated

Code:
[FONT=Courier New]<?php
//Change the path to your MagpieRSS directory
require_once('/html/lib/magpierss/rss_fetch.inc');
//This is the function wrapper for the functionality.
//$url is an RSS feed URL string
function display_feed($url){
//Use MagpieRSS to grab the content of the feed
$rss = fetch_rss($url);
//If you're curious what it looks like, dump out the contents
//print_r($rss);
//We pull out the channel information.
//This could be used to add a title and link to the feed.
//If you were offering the feed to the public, you
//probably want to do that.
$channel = array_slice($rss->channel,0);
//The items are what we'll display
$items = array_slice($rss->items,0);
//Loop through the items
foreach ($items as $item){
//Grab the useful bits of the item
$id = $item['guid'];
$link = $item['link'];
$subject = $item['title'];
$content = $item['content']['encoded'];
$description = $item['description'];
//spit out the actual HTML.
//The sample shows the description with a link to read the
//real item.
print("<div class='post'>");
print("<div class='post-title'>$subject</div>");
print("<div class='content'>$description <a href='$link'>Read Entire Article</a></div>");
print("</div>");
}
}
//This is the mini web service portion
//Check for a feedurl on the request
if($_GET['feedurl']){
//Show the feed directly
display_feed($_GET['feedurl']);
}
?>[/FONT]
 


Top