Created
November 5, 2017 21:10
-
-
Save Joshuaek/416f7119e2c4cf303aa85164d6e4782f 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 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