Skip to content

Commit

Permalink
fixed number of characters killing
Browse files Browse the repository at this point in the history
  • Loading branch information
Desiree Abbott committed Mar 11, 2019
1 parent 397bf43 commit bbdc8a2
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,24 @@
ind2 = k.find(')')
epinfo = k[ind+1:ind2]
killedwhat = k[ind2+2:len(k)]
dat = {'character': char, 'episode_info': episode, 'killed_what': killedwhat, 'kills': 1.0, 'details': k, 'pk': pk}
scraperwiki.sqlite.save(unique_keys=['pk'], data = dat)
pk += 1
if char.find(',') > -1:
ch = char.split(',')
for c in ch:
char = c.replace('and','').strip()
dat = {'character': c, 'episode_info': episode, 'killed_what': killedwhat, 'kills': 1.0/len(ch), 'details': k, 'pk': pk}
scraperwiki.sqlite.save(unique_keys=['pk'], data = dat)
pk += 1
else if char.find(',') == -1 and char.find(' and ') > -1:
ch = char.split(' and ')
for c in ch:
char = c.replace(' and ','').strip()
dat = {'character': c, 'episode_info': episode, 'killed_what': killedwhat, 'kills': 1.0/len(ch), 'details': k, 'pk': pk}
scraperwiki.sqlite.save(unique_keys=['pk'], data = dat)
pk += 1
else:
dat = {'character': char, 'episode_info': episode, 'killed_what': killedwhat, 'kills': 1.0, 'details': k, 'pk': pk}
scraperwiki.sqlite.save(unique_keys=['pk'], data = dat)
pk += 1



Expand Down

0 comments on commit bbdc8a2

Please sign in to comment.