Skip to content

Instantly share code, notes, and snippets.

@Joshuaek
Created November 5, 2017 21:10
Show Gist options
  • Save Joshuaek/416f7119e2c4cf303aa85164d6e4782f to your computer and use it in GitHub Desktop.
Save Joshuaek/416f7119e2c4cf303aa85164d6e4782f to your computer and use it in GitHub Desktop.
import glob
import pathlib
import os
import json
#Make sure we're in the same dir that has the downloaded JSON twitter data
os.chdir('/home/username/twitter_data')
tweets = []
for file in glob.glob('*.json'):
with open(file) as json_data:
data = json.load(json_data)
for tweet in data:
tweets.append(tweet)
#Show how many tweets we've got
print(len(tweets))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment