Jump to content

Recommended Posts

i'm trying to create an rss reader application for facebook using the tutorial at http://www.howtoforge.com/rss_facebook_app_php

 

i followed it directly but get an error when i go onto the page

 

<?php
define('MAGPIE_CACHE_DIR', './magpie_cache');
define('MAGPIE_CACHE_ON', 1);
define('MAGPIE_CACHE_AGE', 600);

require_once('appinclude.php');

require_once('rss/rss_fetch.inc');
$rss = @fetch_rss('http://www.pushbikearmy.co.uk/main/index.php/feed/');

$fbml = '<div style="margin:0 10px 0 10px;">';
$fbml .= '<table border="0" width="100%" style="margin: 5px 5px 5px 5px;"><tr><td valign="top" width="80%"><a href="'.$rss->channel['link'].'" style="font-weight: bold;">'.$rss->channel['title'].'</a></td><td valign="top" width="80%"><fb:share-button class="meta">
  <meta name="medium" content="blog"/>
  <meta name="title" content="'.htmlspecialchars(strip_tags($rss->channel['title'])).'"/>
  <meta name="description" content="'.htmlspecialchars(strip_tags($rss->channel['description'])).'"/>
  <link rel="target_url" href="'.$rss->channel['link'].'"/>
</fb:share-button></td></tr></table>';


foreach ($rss->items as $item) {
        $fbml .= '<div style="border-bottom: 2px solid #CCCCCC; padding-bottom:5px;"><br><div style="border-bottom: 1px dotted #CCCCCC; border-top: 1px dotted #CCCCCC;"><table border="0" width="100%" style="margin: 5px 5px 5px 5px;"><tr><td valign="top" width="80%"><a href="'.$item['link'].'" style="font-weight: bold;">'.$item['title'].'</a></td><td valign="top" width="80%"><fb:share-button class="meta">
  <meta name="medium" content="blog" />
  <meta name="title" content="'.htmlspecialchars(strip_tags($item['title'])).'" />
  <meta name="description" content="'.htmlspecialchars(strip_tags($item['description'])).'" />
  <link rel="target_url" href="'.$item['link'].'" />
</fb:share-button></td></tr></table></div>';
        if($item['description']) $fbml .= $item['description'];
        $fbml .= '</div>';
}
$fbml .= '</div>';

$facebook->api_client->profile_setFBML($fbml, $user);
echo $fbml;
?>

 

the error i get is this

 

Warning: Invalid argument supplied for foreach() in /www/110mb.com/c/h/r/i/s/t/o/p/christopherhide/htdocs/rssreader/index.php on line 20

 

any help would be greatly appreciated...

 

 

thanks

 

chris

Link to comment
https://forums.phpfreaks.com/topic/68282-facebook-app-rss-reader/
Share on other sites

done that

 

now the errors i get are...

 

Warning: MagpieRSS: Failed to fetch http://www.pushbikearmy.co.uk/main/index.php/feed/ (HTTP Error: connection failed () in /www/110mb.com/c/h/r/i/s/t/o/p/christopherhide/htdocs/rssreader/rss/rss_fetch.inc on line 238

 

Warning: Invalid argument supplied for foreach() in /www/110mb.com/c/h/r/i/s/t/o/p/christopherhide/htdocs/rssreader/index.php on line 20

 

 

any ideas?

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.