diff --git a/taptap/collect_mongodb.py b/taptap/collect_mongodb.py index 23c5309..511b7ed 100644 --- a/taptap/collect_mongodb.py +++ b/taptap/collect_mongodb.py @@ -2,7 +2,6 @@ from ops.mmongo import MongodbBase import pdb - # mongodb://10.10.5.4/taptap games # { @@ -82,6 +81,7 @@ import datetime import sys from bson.objectid import ObjectId import json + define_logger("/data/logs/ops/reptile2ss.log") log = logging.getLogger(__name__) MONGOINFO = {'host': '10.10.5.6', 'port': 27017} @@ -93,7 +93,7 @@ conver_int = ('order', 'gameid', 'watch', 'reserve', 'sell', 'download', 'review class CollectMongo(): def __init__(self, item): self.url = "http://10.10.3.17:8992/querySql" - self.api_secret = "GsFnzuKcNOFXsRJbDjV3avy67wTl8tyRD0t0b0VOFbQ285StWmkvT32gtQBVycXp" + self.api_secret = "n9H4R32ZcjtSeN89ljCY6ESzTmOlnwwnOB3r4YsggnP5M1AXLtKtiS4sS1KKLOEQ" self.tga = FromTga(url=self.url, token=self.api_secret) self.item = item self.gameid = self.item.get('gameid') @@ -168,20 +168,18 @@ def read_mongo(start_date, end_date): reptile_4_1['db'] = "taptap" reptile_4_1['coll'] = "games" reptile_4_1['event_name'] = "reptile_4_1" - #reptile_4_1['gameid'] = 9999 + # reptile_4_1['gameid'] = 9999 reptile_4_1['tgaid'] = 6 reptile_4_1['pipeline'] = [{'$match': {'createdAt': {'$gte': start_date, '$lt': end_date}}}, { '$project': {'tags': 1, 'source': 1, 'cateName': 1, 'icon': 1, 'order': 1, 'title': 1, 'author': 1, 'score': 1, - 'desc': 1, 'cate': 1, 'gameid': 1, 'date': 1, 'watch': 1, 'reserve': 1, 'sell': 1, 'download': 1, - 'review': 1, 'topic': 1, 'createdAt': 1, 'updatedAt': 1, 'object_id': '$_id', '_id': 0}}] + 'cate': 1, 'gameid': 1, 'watch': 1, 'reserve': 1, 'sell': 1, 'download': 1, + 'review': 1, 'topic': 1, 'createdAt': 1, 'updatedAt': 1, 'object_id': '$_id', '_id': 0}}] all_type.append(reptile_4_1) for item in all_type: cc = CollectMongo(item) cc.run() - - if __name__ == "__main__": if len(sys.argv) == 2: try: