Created
August 16, 2015 00:29
-
-
Save datapolitan/3b99304ffb6bcb105dee to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#Courtesy of https://gist.github.com/videlais/10d2e4648c7429cbb55b/ | |
import tweepy | |
class TwitterAPI: | |
def __init__(self): | |
consumer_key = "" | |
consumer_secret = "" | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
access_token = "" | |
access_token_secret = "" | |
auth.set_access_token(access_token, access_token_secret) | |
self.api = tweepy.API(auth) | |
def tweet(self, message): | |
self.api.update_status(status=message) | |
if __name__ == "__main__": | |
twitter = TwitterAPI() | |
twitter.tweet("I'm posting a tweet!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment