Skip to content

Instantly share code, notes, and snippets.

View adam-davis's full-sized avatar

Adam Davis adam-davis

View GitHub Profile
@adam-davis
adam-davis / FlickrClean.py
Created January 14, 2012 16:30
OpenBlock Scraper Analysis
def clean_list_record(self, record):
# clean up a record dict
# Item date, in timezone of the photo owner.
# Not sure how to determine what that is, so we'll leave it.
cleaned = {}
cleaned['item_date'] = datetime.datetime.strptime(record['datetaken'],
'%Y-%m-%d %H:%M:%S')
cleaned['item_date'] = cleaned['item_date'].date()
# Posted date, UTC timestamp.
pub_date = datetime.datetime.fromtimestamp(