|
|
@@ -1,6 +1,6 @@
|
|
|
from pymongo import MongoClient, errors, DESCENDING, ASCENDING
|
|
|
from bson.objectid import ObjectId
|
|
|
-from datetime import datetime, timedelta
|
|
|
+from datetime import timedelta
|
|
|
|
|
|
import datetime
|
|
|
import re
|
|
|
@@ -206,7 +206,7 @@ class db():
|
|
|
return r
|
|
|
|
|
|
def get_keywords_with_count(self):
|
|
|
- this_year = datetime.now() - timedelta(days=180)
|
|
|
+ this_year = datetime.datetime.now() - timedelta(days=180)
|
|
|
r = self.c_articles.aggregate([{'$match': {
|
|
|
'$and': [{'matches': True}, {'scrap_date': {'$gt': this_year}}]
|
|
|
}},
|