예제 #1
0
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'])
예제 #2
0
파일: data.py 프로젝트: ebigalee/graeae
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'])
예제 #3
0
 def story_id(self):
     return get_seamus_id_from_url(self.url)
예제 #4
0
 def story_id(self):
     full_path = u'http://www.npr.org{0}'.format(self.data['pagepath'])
     return get_seamus_id_from_url(full_path)
예제 #5
0
 def seamus_id(self):
     """
     Get seamus ID from url
     """
     return get_seamus_id_from_url(self.link_url)