Log in

View Full Version : Help with consuming RSS feed.


itworld
11-19-2008, 07:20 PM
vBulletin newbie. I need to include another sites RSS feed (with MagpieRSS), but can't figure out how to get a php include to work. I've tried putting it in the header with and without the <?php ?>. Will an <IFRAME SRC=... work? or is there a "proper" way of doing this in vB?

TIA, Dave

Lynne
11-19-2008, 08:17 PM
If you want to have it make threads in your forum, then you need to use the RSS Feeds Manager in the Admin CP.

itworld
11-19-2008, 09:22 PM
No, the other way around. Another site creates an RSS feed. I want to pick up that feed and present it (links to articles) on my forum pages.

Lynne
11-19-2008, 11:37 PM
Yeah, that's what the RSS Feed Manager does.

itworld
11-20-2008, 03:27 PM
Thank you, I really appreciate your help, but...
<sigh> I am now getting "XML Error: Empty document at Line 1" when I try to preview http://www.macworldcanada.ca/newsrss.xml.

I'm sure the feed is good, because this code (on the same feed, using magpierss) works.
define('MAGPIE_DIR', 'C:\\Inetpub\wwwroot\\dave\MagpieRSS\\');
require_once(MAGPIE_DIR.'rss_fetch.inc');

$url = 'http://www.macworldcanada.ca/newsrss.xml';

$rss = fetch_rss( $url );
echo '<div style="width:160px;background-color:silver;padding:2px;border:solid black 1px">';
echo '<strong>' . $rss->channel['title'] . '</strong>';
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
echo "<br /><a href=$href" . ' target="_blank">' . $title . "</a>";
}
echo '</div>';

Lynne
11-20-2008, 03:35 PM
When I input the feed into my RSS Feed Manager and do a preview, it is just fine. It also posted just fine on my test board. Try reuploading the rssposter.php file and any other related files to that one.