Twitter Hello World
Update the comments to reflect your student name and tweet: “Hello from AAXXXX” Where AAXXXX is your user ID.
#STUDENT NAME
#PERIOD
#TWITTER HANDLE @MYHANDLE
import tweepy
def TweetTweet(twitter,stringtotweet):
twitter.update_status(stringtotweet)
return(0)
def main():
#You get your token and keys from developer.twitter.com
AccessToken='MyAccessToken'
AccessKey='MyAccessKey'
APIKey='MyAPIKey'
APISecret='MyAPISecret'
#Authenticate to Twitter
auth = tweepy.OAuthHandler(APIKey, APISecret)
auth.set_access_token(AccessToken,AccessKey)
#Initialize teh API with our Token
api = tweepy.API(auth)
#Set our Tweet String
MyTweet="Hello World from <STUDENT USER ID>"
#Send the Tweet
TweetTweet(api,MyTweet)
main()