The Twitter documentation can be found at GET statuses/user_timeline
The returned data is available in json, xml, rss, atom formats, and does not require authorisation allowing me to retrieve the data with very little code.
The data is located at
http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=brianmoreau&count=5
Besides the essential screen_name and data format there are some other variables you can make use of in the URL however I have only included the count variable which controls how many tweets or status to return. This function is also rate limited.
Using PHP
$xml = simplexml_load_file('http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=brianmoreau&count=5');
foreach($xml->children() as $child) {
# GET time and date data
$dateArray = $child->created_at;
$dateTimeString = $dateArray[0];
# GET date
$dateCreated = substr($dateTimeString,0,11);
# GET time
$timeCreated = substr($dateTimeString,11,9);
# GET tweet
$tweet = $child->text;
}
You are then free to use this data in as many creative and most imaginative ways you can devise. |