Created
February 23, 2019 14:22
-
-
Save wybiral/456a15e0fa731273707d7d7f23dd7bac to your computer and use it in GitHub Desktop.
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
import json | |
import sys | |
for line in sys.stdin: | |
# remove newline | |
line = line.rstrip() | |
# parse JSON | |
item = json.loads(line) | |
# get title | |
title = item.get('title', '') | |
# get body | |
body = item.get('body', '') | |
# filter for russia | |
if 'russia' in (title + body).lower(): | |
print(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment