728x90 AdSpace

Latest News
Friday, May 26, 2017

Tweet Using Python

Dear Reader,

Use the below python script to post tweet from your machine.

import tweepy
auth = tweepy.OAuthHandler(customer-key, customer-secret)
auth.set_access_token(access-token, access-token-secret)
api = tweepy.API(auth)
user = api.get_user('twitterhandle')
print user.screen_name
print user.followers_count
tweet = "Your tweet content"
status = api.update_status(status=tweet)

*customer-key, customer-secret, access-token and access-token-secret should be generated from the Twitter developer.

Join the twitter developer account using the url: https://dev.twitter.com/


Create your own twitter application and generate the key and token.

Pass the key value and token value in the above code and execute.

Your tweet will be posted to your twitter handle.

Cheers!!

Regards
Praveen
  • Blogger Comments
  • Facebook Comments

0 comments:

Post a Comment

Item Reviewed: Tweet Using Python Rating: 5 Reviewed By: Praveen Kumar Rajendran