Twitter feed not working – API issue?
-
My twitter feed on my website is not working. It reads “Twitter is not responding.” I’m certain this is an API issue, but don’t know how to fix. It is not a widget, instead this is a Twitter feed that is build into the template sidebar PHP code. Unfortunately, the place where I got the template from does not provide support.
Does anyone know what I should do to edit the code?
<!–the twitter widget–>
<div id=”twitter-entry”>
<?php
$url = ‘https://api.twitter.com/1/statuses/user_timeline.json?screen_name=’ . $apa_Twitter . ‘&count=1’;
$json = @file_get_contents($url);
if($json === FALSE){
echo “<p>Twitter is not responding.</p>”;
}else{
$twitterdata = json_decode($json, true);
$pattern = ‘/@([a-zA-Z]+)/’;
$replace = ‘@1‘;
$output = preg_replace($pattern,$replace,$twitterdata[0][“text”]);
$output = make_clickable($output);
echo ‘<p>’ . $output . ‘</p>’;
}
?>
</div><!–twitter widget–>
- The topic ‘Twitter feed not working – API issue?’ is closed to new replies.