Collect the data from the live twitter
Go to http://apps.twitter.com and create an application The consumer key and secret will be generated for you after "consumer_key" and "consumer_secret"
After the above step, you will be redirected to your app's page. Create an access token under the the "Your access token" section "access_token" and "access_token_secret"
You can see remaining process in the code