Emrah TOY

Tarih : 13-09-2011
Kategori : Yazılım

0

Yorum

I used this code for my wordpress theme.
You may like to change default $username property and if you change rpp value you can get more tweet, its all up to you.
This code returns HTML ready tweet that you dont have to render. Only you may like to set css rule for sub tags.

function getLatestTweet($username=’kalimor’){

$format=’atom’; // set format

$buffer = file_get_contents(“http://search.twitter.com/search.{$format}?q=from:{$username}&rpp=1”);
$xml = new SimpleXMLElement($buffer);

$tweet = $xml->entry->content;
return $tweet; // show latest tweet

}
echo getLatestTweet(‘kalimor’);

PS : This code may not work with private accounts.


Bu blogu sevdinse yazacağım diğer yazıları kaçırmamak için RSS aboneliği yapabilir yada Twitter üzerinden takip edebilirsin. Yazılarımı facebook’da paylaşabilir ve arkadaşlarına önerebilirsin.

Etiketler : , ,

Sende de ki;