-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:DocNow/twarc
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |