Twitter Feed Not Showing Up
-
On my website, I set-up a widget in the sidebar to display an image and my most recent Twitter post. When I first got it set-up it worked fine. I have not made any changes to the code, but now the most recent Twitter post is not showing up.
Below is the code I am using.
Any suggestions?
Thanks,
<h3>Edward on Twitter…</h3>
<div style=”width:290px”>
<div style=”font-family:Myriad Pro,arial; font-size:12px; color:#FFFFFF;
padding:7px 10px 0px 77px; min-height:110px;
background:url(https://makereadyfitness.com/wp-content/uploads/TwitterWidget.jpg) no-repeat;”>
<?php
// Your twitter username.
$username = “stedmaniv”;
// Prefix – some text you want displayed before your latest tweet.
// (HTML is OK, but be sure to escape quotes with backslashes: for example href=\”link.html\”)
$prefix = “”;
// Suffix – some text you want display after your latest tweet. (Same rules as the prefix.)
$suffix = “”;
$feed = “https://search.twitter.com/search.atom?q=from:” . $username . “&rpp=1”;
function parse_feed($feed) {
$stepOne = explode(“<content type=\”html\”>”, $feed);
$stepTwo = explode(“</content>”, $stepOne[1]);
$tweet = $stepTwo[0];
$tweet = str_replace(“'”, “‘”, $tweet);
$tweet = str_replace(“<“, “<“, $tweet);
$tweet = str_replace(“>”, “>”, $tweet);
$tweet = str_replace(“"”, “"”, $tweet);
$tweet = str_replace(“<”, “<“, $tweet);
$tweet = str_replace(“>”, “>”, $tweet);
$tweet = str_replace(“"”, “\””, $tweet);
return $tweet;
}
$twitterFeed = file_get_contents($feed);
echo stripslashes($prefix) . parse_feed($twitterFeed) . stripslashes($suffix);
?>
</div>
- The topic ‘Twitter Feed Not Showing Up’ is closed to new replies.