Twitter JSON को समझना

Python में सोशल मीडिया डेटा का विश्लेषण

Alex Hanna

Computational Social Scientist

Twitter JSON की सामग्री

{  "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,
      ...  }
  • कितने retweets, favorites
  • भाषा
  • किस ट्वीट को reply
  • किस यूज़र को reply
Python में सोशल मीडिया डेटा का विश्लेषण

Child JSON ऑब्जेक्ट्स

{
        "user": {
            "id": 661613,
            "name": "Alex Hanna, Data Witch",
            "screen_name": "alexhanna",
            "location": "Toronto, ON",
            ...
         }
}
Python में सोशल मीडिया डेटा का विश्लेषण

Places, retweets/quoted tweets, और 140+ ट्वीट्स

  • place और coordinate
    • geolocation रखते हैं
  • extended_tweet
    • 140 कैरेक्टर से बड़े ट्वीट्स
  • retweeted_status और quoted_status
    • रिट्वीट और कोट किए ट्वीट्स की पूरी जानकारी रखते हैं
Python में सोशल मीडिया डेटा का विश्लेषण

JSON तक पहुँचना

import json

tweet_json = open('tweet-example.json', 'r').read()

tweet = json.loads(tweet_json)
tweet['text']
Python में सोशल मीडिया डेटा का विश्लेषण

Child tweet JSON

tweet['user']['screen_name']

tweet['user']['name']
tweet['user']['created_at']
Python में सोशल मीडिया डेटा का विश्लेषण

अभ्यास करते हैं!

Python में सोशल मीडिया डेटा का विश्लेषण

Preparing Video For Download...