Skip to content

Instantly share code, notes, and snippets.

@hmason
Created October 15, 2010 19:18
Show Gist options
  • Save hmason/628758 to your computer and use it in GitHub Desktop.
Save hmason/628758 to your computer and use it in GitHub Desktop.
import sys, os
import json
if __name__ == '__main__':
f = open("formatted_tweets.json")
data = f.read()
f.close()
tweets = json.loads(data)
for tweet in tweets:
try:
print tweet['text']
except UnicodeEncodeError:
pass
@hughdbrown
Copy link

from json import loads

if name == 'main':
with open("formatted_tweets.json") as f:
for tweet in loads(f.read()):
try:
print tweet['text']
except UnicodeEncodeError:
pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment