Parsing real-time data using Twitter Streaming API

6,185
-1

Published on

Published in: Technology, Business

Parsing real-time data using Twitter Streaming API

  1. 1. Parsing Real-time Tweets Ramanujam Parthasarathy Monetate @ramanujam http://github.com/ramanujamWednesday, May 30, 12
  2. 2. Why? • Freely available public intelligence • News reaches twitter super fast and spreads • 250 million tweets per day (Oct ‘11) • Track keywords, sentiment analysis, data mining • Because you can!Wednesday, May 30, 12
  3. 3. Twitter Streaming API https://stream.twitter.com/1/statuses/filter.jsonWednesday, May 30, 12
  4. 4. Twitter Streaming API curl https://stream.twitter.com/1/ statuses/filter.json? track=SEARCH_PARAMETER - uUSERNAME:PASSWORDWednesday, May 30, 12
  5. 5. Twitter Python Libraries • Tweepy • Python Oauth2 • Python Twitter • Twython • Twitty Twister • Tweetstream Use a library that has support for OauthWednesday, May 30, 12
  6. 6. Get your auth keysWednesday, May 30, 12
  7. 7. Basic keyword/hashtag tracking Set the keywords to track Print the status File: tracker.pyWednesday, May 30, 12
  8. 8. Save to MongoDB Pymongo (http://api.mongodb.org/python/2.2/ index.html) is a recommended way to work with MongoDB from PythonWednesday, May 30, 12
  9. 9. Plot some data Pie chart of the devices used by people who tweet about Obama and Romney File: plotapps.pyWednesday, May 30, 12
  10. 10. Play some music #pugmusic http://tinysong.com/6OABWednesday, May 30, 12
  11. 11. Play some music File: playmusic.pyWednesday, May 30, 12
  12. 12. Enqueue more songs • Grooveshark javascript api • addSongsByID • window.Grooveshark.addSongsByID(13766524)Wednesday, May 30, 12
  13. 13. Notify Twilio API to send a text or make a call based on an event trigger (eg: > 10 statuses in a 10 second window) setTerms = [$AAPL, down, 530] setTerms = [‘aws’, ‘down’] setTerms = [‘phillies’, ‘win’] File: sendtext.pyWednesday, May 30, 12
  14. 14. Thank You! http://github.com/ramanujam/pugtalkWednesday, May 30, 12
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×