srohit24
19th March 2009, 07:16
I have written a program that contacts twitter API to get the 20 latest tweets. Here is the code.
<html>
<head><title>
Twitter API
</title></head>
</html>
<?php
$login = "1"; //Add the Username:password 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);
?>
Now i need to write the same thing in Qt. Contacting the twitter API. How can i accomplish it?
thanks
<html>
<head><title>
Twitter API
</title></head>
</html>
<?php
$login = "1"; //Add the Username:password 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);
?>
Now i need to write the same thing in Qt. Contacting the twitter API. How can i accomplish it?
thanks