I automated a twitter update from a random fortune quote, using python and the tweepy library.
First i installed tweepy
# pip install tweepy
Then, created /opt/bin/tweepy
#!/opt/bin/python import tweepy, sys, commands quote=commands.getoutput("/opt/bin/fortune") consumer_key, consumer_secret, access_token, access_token_secret = "xxxxxx", "xxxx", "xxx", "xxx" auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) api = tweepy.API(auth) #print "Successfully logged in as " + api.me().name + "." api.update_status(quote)
And.. that’s it!. As easy as 1..2..