forked from robincamille/bot-tutorial-jumpstart-2020
-
Notifications
You must be signed in to change notification settings - Fork 0
/
listbot.py
executable file
·33 lines (23 loc) · 824 Bytes
/
listbot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Twitter Bot Starter Kit: Bot 1
# This bot tweets three times, waiting 15 seconds between tweets.
# If you haven't yet created credentials.py, modify credentials.template
# to include your own Twitter account settings. This script will then tweet
# using your bot's account.
# Housekeeping: do not edit
import tweepy, time
from credentials import *
auth = tweepy.OAuthHandler(API_KEY, API_SECRET)
auth.set_access_token(ACCESS_TOKEN, ACCESS_SECRET)
api = tweepy.API(auth)
# What the bot will tweet
tweet_list = ['', 'Day 2!', 'Yeah!']
# loop through the tweet_list and tweet each item
for line in tweet_list:
print('About to tweet:')
print(line)
api.update_status(status=line)
print('...')
time.sleep(0) # Sleep for 15 seconds
print("All done!")