-
Notifications
You must be signed in to change notification settings - Fork 16
/
book_bot.py
57 lines (43 loc) · 1.07 KB
/
book_bot.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import tweepy, re, time
from access import *
from random import randint
# Setup API:
# TODO
# Function to extract status (will return status for post):
def extract_status(path=None):
# No path => return "No book opened!"
# TODO
# Try to search a sentence in book:
try:
# Open and read textbook:
# TODO
# If successfuly read, search sentence:
# TODO
except:
# Book not found:
# TODO
# Function to search a sentence in book:
def search_sentence(text):
# Initialize status:
# TODO
# While we have a long or very short status:
while not (5 < status < 125):
# Generate a random number:
# TODO
# Set indices of sentence:
# TODO
# Replace breaks w/spaces:
# TODO
if __name__ == '__main__':
# Setup Twitter API:
# TODO
# Set waiting time:
segs = 3
# Eternal posting:
while True:
# Extract status:
# TODO
# Try to post status:
# TODO
# Wait till next sentence extraction:
time.sleep(segs)