Twitter error - HTTP Code error 410 https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=shonirits&count=3


#1

Im trying to fetch my tweet using PHP but getting error 410 gone. below is my code:

<?php $doc = new DOMDocument(); # load the RSS document, edit this line to include your username or user id if($doc->load('https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=shonirits&count=3')) { # specify the number of tweets to display, max is 20 $max_tweets = 3; $i = 1; echo "\n"; foreach ($doc->getElementsByTagName('item') as $node) { # fetch the title from the RSS feed. # Note: 'pubDate' and 'link' are also useful (I use them in the sidebar of this blog) $tweet = $node->getElementsByTagName('title')->item(0)->nodeValue; # the title of each tweet starts with "username: " which I want to remove $tweet = substr($tweet, stripos($tweet, ':') + 1); # OPTIONAL: turn URLs into links $tweet = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', '$1', $tweet); # OPTIONAL: turn @replies into links $tweet = preg_replace("/@([0-9a-zA-Z]+)/", "@$1", $tweet); echo "
  • ".$tweet."

  • "; if ($i++ >= $max_tweets) break; } echo "\n"; } ?>

    #2