def read_json(directory, data_files='<STR_LIT>'):
files = path.join(directory, data_files)<EOL>for fname in iglob(files):<EOL><INDENT>with open(fname, '<STR_LIT:r>') as f:<EOL><INDENT>data = f.readlines()[<NUM_LIT:1>:]<EOL>data = "<STR_LIT>".join(data)<EOL>tweetlist = json.loads(data)<EOL><DEDENT>for tweet in tweetlist:<EOL><INDENT>yield tweet<EOL><DEDENT><DEDENT>
Scrape a twitter archive file.
Inspiration from https://github.com/mshea/Parse-Twitter-Archive