This application plots live Periscope broadcasts on a map. It does this by using the Twitter streaming API to collect tweets that advertise a live Periscope broadcast, and then plot those tweets on a Google map.
Periscope does not expose their API, and the tweets advertising a Periscope broadcast are not geotagged. To get around this, I used Capybara to scrape a Periscope broadcast web page to capture the city and then geocoded that city with the Geocoder gem.
That data is then passed off to the browser client over web sockets.
- Ruby 2.1.0
- Mongo installed locally
This app relies on a number of external services which require an API key to access. These API keys are not checked into this repo; you must get your own keys. The following API keys are required and must be available in the app's global environment (ENV):
CONSUMER_KEY (Twitter consumer key) CONSUMER_SECRET (Twitter consumer secret) ACCESS_TOKEN (Twitter access token) ACCESS_TOKEN_SECRET (Twitter access token secret) GOOGLE_API_KEY (Google API key to use Maps) PUBNUB_PUBLISH_KEY (Pubnub key to publish message) PUBNUB_SUBSCRIBE_KEY (Pubnub key to subscribe to message)
- Clone this Rails app.
- In the app directory, install gems:
bundle install - Ensure you have your API keys populated (see above section, "API Keys")
- Start MongoDB:
sudo mongod - Start Rails:
rails s - Start polling: (from within the app's Rails console, run):
TwitterService.start_polling - Open the app in a browser: `http://localhost:3000