Analyzing Social Media Data in Python
Alex Hanna
Computational Social Scientist
{ "created_at": "Thu Apr 19 14:25:04 +0000 2018",
"id": 986973961295720449,
"id_str": "986973961295720449",
"text": "Writing out the script of my @DataCamp class
and I can't help but mentally read it back to myself in
@hugobowne's voice.",
"retweet_count": 0,
"favorite_count": 1,
... }
{
"user": {
"id": 661613,
"name": "Alex Hanna, Data Witch",
"screen_name": "alexhanna",
"location": "Toronto, ON",
...
}
}
place
and coordinate
extended_tweet
retweeted_status
and quoted_status
import json tweet_json = open('tweet-example.json', 'r').read()
tweet = json.loads(tweet_json)
tweet['text']
tweet['user']['screen_name']
tweet['user']['name']
tweet['user']['created_at']
Analyzing Social Media Data in Python