Hi, Im using the URL below for accessing my latest twitter feed
http://api.twitter.com/1/statuses/user_timeline.json?screen_name=’.$twitter_id.’&include_rts=1&count=’.$no_of_feed
and i’m using the following PHP codes to do that:
<?php
$twitter_id = "prof_abbynucup";
$no_of_feed = 1;
function linkable($text = ''){
$text = preg_replace("/\s+/", ' ', str_replace(array("\r\n", "\r", "\n"), ' ', $text));
$data = '';
foreach( explode(' ', $text) as $str){
if (preg_match('#^http?#i', trim($str)) || preg_match('#^www.?#i', trim($str))) {
$data .= '
'.$str.' ';
} else {
$data .= $str .' ';
}
}
return trim($data);
}
$responseJson = file_get_contents('https://api.twitter.com/1/statuses/user_timeline/'.$twitter_id.'.json?callback=twitterCallback2&count='.$no_of_feed);
if($responseJson) {
$responseAray = json_decode($responseJson);
foreach($responseAray as $resp) {
$crea = linkable($resp->created_at);
$postedLast = explode(" ", $crea);
?>
<a href="https://twitter.com/<?php echo $resp->user->screen_name; ?>" target="_blank">@<?php echo $resp->user->screen_name; ?></a> <b>said:</b> <?php echo linkable($resp->text); ?> <b>last</b> <?php echo $postedLast[0]." - ".$postedLast[1]." ".$postedLast[2].", ".$postedLast[5]; ?><br />
<?php
}
}
?>
the code above is working great before, but since API v1 is no longer functional, I’ve tried using @WyandanchLib 's code:
“htmls://api.twitter.com/1/statuses/user_timeline/WyandanchLib.json?callback=twitterCallback2&count=1”
and @quantitsearch 's code too:
https://api.twitter.com/1/statuses/user_timeline/youraccountname.json?callback=twitterCallback2&count=4
but still no good. can anyone help me? please…