Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions reddit-analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@

# fetch profile data
r3 = requests.get('https://www.reddit.com/user/'+username+'/about.json', headers=headers)
userdata = r3.json()['data']

# if not found or 404 returned, exit
if (r3.json()['message'] == 'Not Found' or r1.json()['error'] == 404):
print("No Account Details Found, 404 Received")
exit()
else:
userdata = r3.json()['data']

# fetch comments
while True:
Expand Down Expand Up @@ -187,4 +193,4 @@ def timeGraph(timelist):
print(' ')
getComments()
print(' ')
timeGraph(timelist)
timeGraph(timelist)