Skip to content

Commit

Permalink
fixing place name sql
Browse files Browse the repository at this point in the history
  • Loading branch information
yuletide committed Jun 9, 2014
1 parent 5f0e3be commit 42d6777
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scraper.py
Expand Up @@ -146,11 +146,11 @@ def get_band_by_id(id):


def clean_old_placenames():
records = scraperwiki.sqlite.select("* from data WHERE location_utf is NULL limit 500")
records = scraperwiki.sqlite.select("* from data WHERE location IS NOT NULL and location_utf is NULL limit 500")
for band in records:
band['location_utf'] = band['location'].encode('ISO-8859-1').decode('utf-8')
scraperwiki.sqlite.save(unique_keys=['id'], data=band)
print band['location_utf']
print band

#to test encoding
#scrape_band(get_band_by_id(5678))
Expand Down

0 comments on commit 42d6777

Please sign in to comment.