示例#1
0
def main():
    db = get_db()
    
    for c in db.comps.find():
        updated = grab_updated(c)
        c['updated'] = updated
        db.comps.save(c)
        print u'Done: {0} ({1})'.format(c['link'], updated)
示例#2
0
def main():
    if len(sys.argv) == 1:
        limit = 0
    else:
        limit = int(sys.argv[1])
    db = get_db()
    for c in db.comps.find(sort=[('updated', pymongo.ASCENDING)], limit=limit):
        print u'http://www.reddit.com{0}{1}'.format(c['link'], c['pages'][0]['rid'][3:])