A real-time 3D visualization of Tweets from around the world.
This web app attaches to the Twitter API stream/filter and runs rudimentry sentiment analysis on Tweets with geo data. Tweets are published via PubNub websockets and plotted to a 3D globe.
Inspired by the Web GL Globe Chrome Experiment and the PubNub Real-Time WebGL Visualization.
![Screenshot](screenshot.png?raw=true =858x "Screenshot") Video Capture | Running Demo (Availability of this server may fluctuate)
Install Node.js.
Clone GitHub repo:
https://github.com/twitterdev/twitter-stream-globe.git
Create a Twitter app and PubNub account:
- Create a Twitter application.
- Create a PubNub account (it's free).
Create a config.json file using config.sample.json as a template. Fill in your Twitter App API and PubNub keys.
Install Compass Ruby Gem.
gem install compass
If you do not want Compass support, comment out this line in app.js
// app.use(require('node-compass')({mode: 'compress'}));
Install node module dependencies:
npm install
Run application:
npm start
Go to http://localhost:3000 in your browser.
This application is ready to run on a free OpenShift or Heroku account.
Heroku
You can deploy to Heroku via Git with the Heroku toolbelt.
Before deploying to Heroku, set your environment config vars to mirror config.json, and set NODE_ENV
to "production."
OpenShift
You can deploy to OpenShift with rhc
, by adding your own keys to the following command:
rhc app create twglobe nodejs-0.10 \
--from-code=http://github.com/twitterdev/twitter-stream-globe.git \
NODE_ENV=production \
TWITTER_CONSUMER_KEY=YOUR_TWITTER_CONSUMER_KEY \
TWITTER_CONSUMER_SECRET=YOUR_TWITTER_CONSUMER_SECRET \
TWITTER_ACCESS_TOKEN=YOUR_TWITTER_ACCESS_TOKEN \
TWITTER_TOKEN_SECRET=YOUR_TWITTER_TOKEN_SECRET \
PUBNUB_PUBLISH_KEY=YOUR_PUBNUB_PUBLISH_KEY \
PUBNUB_SUBSCRIBE_KEY=YOUR_PUBNUB_SUBSCRIBE_KEY