twitter-php classe php per ricevere e inviare messaggi a twitter

Posted on 09. Jun, 2009 by Administrator in script php, social network


Create object using your credentials (user name and password)

$twitter = new Twitter($userName, $password);
The send() method updates your status. The message must be encoded in UTF-8:

$twitter->send('I am fine today.');
The load() method returns the 20 most recent status updates posted in the last 24 hours by you and optionally by your friends:

$withFriends = FALSE;
$channel = $twitter->load($withFriends);
The returned channel is a SimpleXMLElement object. Extracting the information from the channel is easy:

foreach ($channel->status as $status) {
echo "message: ", $status->text;
echo "posted at " , $status->created_at;
echo "posted by " , $status->user->name;
}

Sito web: http://code.google.com/p/twitter-php/


Correlati

Leave a reply