$sudo python tweeter.py 'Message I want to tweet'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import tweepy | |
CONSUMER_KEY = 'Cant show this part' | |
CONSUMER_SECRET = 'Cant show this part' | |
ACCESS_KEY = 'Cant show this part' | |
ACCESS_SECRET = 'Cant show this part' | |
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) | |
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET) | |
api = tweepy.API(auth) | |
api.update_status(sys.argv[1]) |
I can't show you the sensitive information from Twitter for obvious reasons, but you should plug your information into those spots and it should work for you. You do need to visit the developer Twitter website to set up the API, link it to your account, and have they give you your appropriate numbers. Here is the tutorial I followed to get this done.
http://c-mobberley.com/wordpress/index.php/2013/04/26/raspberry-pi-connect-to-twitter-account-using-tweepy-installation-and-tweet-cpu-temperature-example/
No comments:
Post a Comment