8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f035a6 commit 3fc2562Copy full SHA for 3fc2562
21_twitter_bot.py
@@ -0,0 +1,25 @@
1
+import tweepy
2
+
3
+# Authentication credentials - dev.twitter.com
4
+cfg = {
5
+ 'consumer_key': 'VALUE',
6
+ 'consumer_secret': 'VALUE',
7
+ 'access_token': 'VALUE',
8
+ 'access_token_secret': 'VALUE'
9
+}
10
11
12
+def get_api_handler(cfg):
13
+ auth = tweepy.OAuthHandler(cfg['consumer_key'], cfg['consumer_secret'])
14
+ auth.set_access_token(cfg['access_token'], cfg['access_token_secret'])
15
+ return tweepy.API(auth)
16
17
18
+def main():
19
+ api = get_api_handler(cfg)
20
+ tweet = 'Hello, world from Tweepy!'
21
+ api.update_status(status=tweet)
22
23
24
+if __name__ == "__main__":
25
+ main()
0 commit comments