<html>
<head><title>
Twitter API
</title></head>
</html>
<?php
$login = "1"; //Add the Username

assword for authenticated sessions
$tweets = "http://twitter.com/statuses/public_timeline.xml";
$tw = curl_init();
curl_setopt($tw, CURLOPT_URL, $tweets);
curl_setopt($tw, CURLOPT_USERPWD,$login);
curl_setopt($tw, CURLOPT_RETURNTRANSFER, TRUE);
$twi = curl_exec($tw);
$tweeters = new SimpleXMLElement($twi);
$latesttweets = count($tweeters);
//echo the data
foreach ($tweeters->status as $twit1) {
echo "<div class='name'>",'<b>'.$twit1->user->name.'</b>',"</div>";
echo "<div class='text'>".$twit1->text." <div class='description'>","</div></div></div>";
}
curl_close($tw);
?>
Bookmarks