Step 1: Register your application with twitter. Here is the link to do that :http://dev.twitter.com/apps/new
After registration you will be provided with consumer and secret key to be used for authentication. Though during registration process twitter will ask you to provide domain name. It does not means that you need to commit your files to that domain, you can work locally too.
Step 2: Download OAuth library for the language that you'd be using for developement. I am using PHP and downloaded quite a few libraries to try namely :
http://classes.verkoyen.eu/twitter_oauth
http://github.com/themattharris/tmhOAuth/
Step 4 : First Example
As a first timer use this example :
and just copy and paste the code to get the feel of the API.
Step 4 : Replace blanks with appropriate values from your app of the following variables :
'consumer_key' => '',
'consumer_secret' => '',
'user_token' => '',
'user_secret' => '',
'consumer_secret' => '',
'user_token' => '',
'user_secret' => '',
Step 5 : Save the file and run in your web browser. I used xampp for server.
Step 6 : Voila !!!! you just updated the status from PHP API.
More to come...
No comments:
Post a Comment