def fix_fb_seamus_ids(): db = dataset.connect(app_config.POSTGRES_URL) fb = db['facebook'] for row in fb.all(): if row['link_url']: update = { 'seamus_id': get_seamus_id_from_url(row['link_url']), 'id': row['id'] } print 'updating %s' % update fb.update(update, ['id'])
def story_id(self): return get_seamus_id_from_url(self.url)
def story_id(self): full_path = u'http://www.npr.org{0}'.format(self.data['pagepath']) return get_seamus_id_from_url(full_path)
def seamus_id(self): """ Get seamus ID from url """ return get_seamus_id_from_url(self.link_url)