def parse_log(item): if 'source_id' in item: oid = item['source_id'] if(item['action'] == 'click'): db.dotmarks.update( {"_id": ObjectId(oid)}, {"$inc": {"views": 1}, "$set": {LAST_UPDATED: get_date()}}, upsert=False) if(item['action'] == 'star'): updates = {'star': 'true' in item['value']} do_update(oid, updates)
def populate_dotmark(item): logger.info("processing %s" % item['url']) updates = {} if 'url' and '_id' in item: if 'title' not in item or not item['title']: updates['title'] = get_title_from_url(item['url']) item['title'] = updates['title'] atags = auto_tag(item) if atags: updates['atags'] = atags if updates: do_update(item['_id'], updates)
def parse_log(item): if 'source_id' in item: oid = item['source_id'] if (item['action'] == 'click'): db.dotmarks.update({"_id": ObjectId(oid)}, { "$inc": { "views": 1 }, "$set": { LAST_UPDATED: get_date() } }, upsert=False) if (item['action'] == 'star'): updates = {'star': 'true' in item['value']} do_update(oid, updates)