|
|
@@ -23,11 +23,13 @@ def post_data(field, keys, value):
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
from db import db
|
|
|
- from pprint import pprint
|
|
|
d = db()
|
|
|
errors = d.get_sources_with_error()
|
|
|
for e in errors:
|
|
|
val = e['_id'].replace(" ", r"\ ")
|
|
|
post_data('error', {'source': '%s' % val}, e['count'])
|
|
|
|
|
|
- pprint(list(d.get_sources_with_count()))
|
|
|
+ for d in d.get_sources_with_count():
|
|
|
+ val = d['_id'].replace(" ", r"\ ")
|
|
|
+ post_data('totals', {'source': '%s' % val},
|
|
|
+ '%d,weight=%f' % (d['count'], d['weight']))
|