Tuesday, October 20, 2009

Twitter API for creating your own Twitter application.


As I explained in the previous post, twitter is becoming the leading social media and micro blogging site.

Web interface of Twitter is having limited features only. So there are lot of twitter applications available for providing more features.

If you want to create your own Twitter application for any specific need, you can do it by using twitter API.

If you know CURL you can easily create any new Twitter applications.
For example, below simple php code using cURL can be used for posting message with tiny url into your twitter account without using web interface.

I will be writing more details about cURL in coming posts.

If you are new to cURL, you can bookmark this blog for further reading, or you can subscribe to our blog feed.

$twitter_url = 'http://twitter.com/statuses/update.xml';
$uname = '';//example "qualitypoint" for twitter.com/qualitypoint, or email address
$pwd = ''; //enter the password
$title='' ; //enter the message
$url=''; //url that needs be included in the message

$tiny_url = getContents("http://tinyurl.com/api-create.php?url=" . $url);
$status = $title . " " . $tiny_url;

$curl_handle = curl_init();
curl_setopt($curl_handle,CURLOPT_URL,"$twitter_url");
curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl_handle,CURLOPT_POST,1);
curl_setopt($curl_handle,CURLOPT_POSTFIELDS,"status=$status");
curl_setopt($curl_handle,CURLOPT_USERPWD,"$uname:$pwd");
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);

Contact Us if you want to develop your own Custom Twitter applications.

More Articles...

No comments:

Search This Blog