Jump to content

problem with twitter feed


c_pattle

Recommended Posts

I have the following code that grabs my twitter feed and displays it on my website.  When I tested this on my local version it works fine but when I uploaded it to my webspace it doesn't seem to work.  I don't think it's a problem with the coding, maybe a permission problem on the server?

 

$doc = new DOMDocument();
$doc->load('https://twitter.com/statuses/user_timeline/155522147.rss');
$doc -> save ("webmango_twitter.xml");

$channel = $doc->getElementsByTagName("channel");

foreach($channel as $chnl) {

$item = $chnl->getElementsByTagName("item");

foreach($item as $itemgotten) {

$describe = $itemgotten->getElementsByTagName("description");
$publish_date =  $itemgotten->getElementsByTagName("pubDate");

$twitter_description = $describe->item(0)->nodeValue;
$twitter_postdate = $publish_date->item(0)->nodeValue;

$_SESSION['twitter'] .= "<li>" . $twitter_description . " - Posted on: " . $twitter_postdate . "</li>";
}
}

Link to comment
https://forums.phpfreaks.com/topic/204788-problem-with-twitter-feed/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.