@@ -30,4 +30,4 @@ if __name__ == '__main__':
val = e['_id'].replace(" ", r"\ ")
post_data('error', {'source': '%s' % val}, e['count'])
- pprint(d.get_sources_with_count())
+ pprint(list(d.get_sources_with_count()))
@@ -191,6 +191,7 @@ class db():
return r
def get_sources_with_count(self):
+ # TODO filter with scrap_date, this year mb?
r = self.c_articles.aggregate([{'$match': {'matches': True}},
{'$group':
{'_id': '$source_name',