Skip to content

Commit

Permalink
Merge branch 'master' of github.com:DocNow/twarc
Browse files Browse the repository at this point in the history
  • Loading branch information
edsu committed Jan 29, 2017
2 parents 17015dd + fd6fae5 commit 5927c3c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions utils/remove_limit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python

"""
Utility to remove limit warnings from Filter API output.
If --warnings was used, you will have the following in output:
{"limit": {"track": 2530, "timestamp_ms": "1482168932301"}}
This utility removes any limit warnings from output.
Usage:
remove_limit.py aleppo.json > aleppo_no_warnings.json
"""

from __future__ import print_function
import sys
import json
import fileinput

limit_breaker = '{"limit": {"track":'

for line in fileinput.input():
if limit_breaker not in line:
print(json.dumps(line))

0 comments on commit 5927c3c

Please sign in to comment.