Skip to content

Commit

Permalink
fixed retweet check
Browse files Browse the repository at this point in the history
  • Loading branch information
bpb27 committed Dec 16, 2016
1 parent d1b84be commit 57e73ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions get_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from time import sleep

# CHANGE THIS TO THE USER YOU WANT
user = 'SheriffClarke'
user = 'realdonaldtrump'

with open('api_keys.json') as f:
keys = json.load(f)
Expand Down Expand Up @@ -56,7 +56,7 @@
results = []

def is_retweet(entry):
return entry['user']['screen_name'].lower() != user.lower()
return 'retweeted_status' in entry.keys()

def get_source(entry):
if '<' in entry["source"]:
Expand Down
8 changes: 4 additions & 4 deletions scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@


# edit these three variables
user = 'SheriffClarke'
start = datetime.datetime(2014, 12, 20) # year, month, day
end = datetime.datetime(2014, 12, 23) # year, month, day
user = 'realdonaldtrump'
start = datetime.datetime(2010, 1, 1) # year, month, day
end = datetime.datetime(2016, 12, 7) # year, month, day

# only edit these if you're having problems
delay = 1 # time to wait on each page load before reading the page
Expand Down Expand Up @@ -58,7 +58,7 @@ def increment_day(date, i):
found_tweets = driver.find_elements_by_css_selector(tweet_selector)
increment += 10

print('{} tweets found'.format(len(found_tweets)))
print('{} tweets found, {} total'.format(len(found_tweets), len(ids)))

for tweet in found_tweets:
try:
Expand Down

0 comments on commit 57e73ae

Please sign in to comment.