· 6 years ago · Oct 31, 2019, 10:02 PM
1import tweepy
2
3
4
5# Create variables for each key, secret, token
6
7consumer_key = 'PJi9BGmPIMDwYJAz6qwMeFZSI'
8
9consumer_secret = '4223jbTKininO5X46LCMJSe4mIYZr37ej3TqogWpzLKObMUfMQ'
10
11access_token = '2184733530-LzzIUZ3orrgONsQIJ9ErhlMJSeKUxs6I2eousV1'
12
13access_token_secret = '25SnKlKAWd6ETiiw9fakj787REeY1JCuiZERcPWZMWjN7'
14
15
16
17# Set up OAuth and integrate with API
18
19auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
20
21auth.set_access_token(access_token, access_token_secret)
22
23api = tweepy.API(auth)
24
25
26
27# Write a tweet to your Twitter account
28
29tweet = input("Input your tweet here: ")
30
31api.update_status(status=tweet)
32
33input()