-
Notifications
You must be signed in to change notification settings - Fork 0
/
top-comments-final.py
48 lines (39 loc) · 1.44 KB
/
top-comments-final.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
import praw
reddit = praw.Reddit(client_id='YOURCLIENTID',
client_secret='YOURCLIENTSECRET',
password='YOURPASSWORD',
user_agent='testscript by /u/fakebot3',
username='YOURUSERNAME')
baidu = []
baiduScore = []
facebook = []
facebookScore = []
microsoft = []
microsoftScore = []
for submission in reddit.subreddit('investing+AMD_Stock+StockMarket').submissions(1426837664, 1489996064):
title = submission.title
updoots = submission.score
agnosticTitles = str(title).lower()
# verylargdic = dict(*zip(agnosticTitles, updoots))
if "baidu" in agnosticTitles:
baidu.append(title)
baiduScore.append(updoots)
if "facebook" in agnosticTitles:
facebook.append(title)
facebookScore.append(updoots)
if "microsoft" in agnosticTitles:
microsoft.append(title)
microsoftScore.append(updoots)
print(baidu, facebook, microsoft)
# if any("baidu" in key for key in verylargdic):
# baidu.append(submission.title)
# baiduScore.append(submission.score)
# if any("facebook" in key for key in verylargdic):
# facebook.append(submission.title)
# facebookScore.append(submission.score)
# if any("microsoft" in key for key in verylargdic):
# microsoft.append(submission.title)
# microsoftScore.append(submission.score)
# testDict = {"baidu sucks ass" : 234, "microsoft sucks ass" : 273}
# if any("baidu" in key for key in testDict):
# print(testDict["baidu sucks ass"])