-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
49 lines (22 loc) · 786 Bytes
/
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
# eecs398-python-twitter
# libraries
from datetime import datetime
from datetime import timedelta
from email.utils import parsedate_tz
# TODO: import additional libraries for this project
# class to hold tweets for debugging
class Tweet():
def __init__(self, message_in, user_in, time_in):
self.message = message_in
self.user = user_in
self.time = matplotlib.dates.date2num(time_in)
def __str__(self):
return "{} tweeted at {}: {}".format(self.user, self.time, self.message)
# TODO: generate Twitter session
# TODO: ask user for hashtag to search
# TODO: search for hashtag and store results
# store Tweet objects in a list
tweets = []
times = []
# store results
# TODO: graph data from Twitter using matplotlib