earls is a hack to display web resources that are being tweeted with a given hashtag. It uses node and redis to watch Twitter for new tweets with urls, then fetches the web resource, attempts to pull the title out of the HTML, and then stashes away some results into a Redis database The idea is that it can help share information about what is being tweeted about at conferences, and other real or virtual events that people are tweeting at.
When your event is over it is easy to create a static site of your earls instance and turn off the node server and redis backend, and just let it be served up as HTML, CSS and JavaScript.
- install redis and node
- git clone https://github.com/edsu/earls
- cd earls
- npm install
- set Twitter credentials in environment: TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET, TWITTER_ACCESS_TOKEN, TWITTER_ACCESS_TOKEN_SECRET
- set ENV about TCP/IP port and IP address using EARLS_PORT=Your-Port amd EARLS_HOSTNAME="Your-IP"
- ./earls.js '#c4l15'
To get things to run on Heroku you'll need to set some environment variables before you can push there:
heroku config:set EARLS_TRACK=#c4l15
heroku config:set EARLS_PORT=Your-Port
heroku config:set EARLS_HOSTNAME="Your-IP"
heroku config:set TWITTER_CONSUMER_KEY=XXX
heroku config:set TWITTER_CONSUMER_SECRET=XXX
heroku config:set TWITTER_ACCESS_TOKEN=XXX
heroku config:set TWITTER_ACCESS_TOKEN_SECRET=XXX
EARLS_PORT, earls default port is 3000. EARLS_HOSTNAME, earls default hostname is "" (listen and bind on all local IP interfaces like "*").
earls listens for new tweets. If you'd like to add some existing tweets that you've collected with twarc you can load them into redis like so:
./load.js tweets.json
This will connect to a local redis instance by default. If you would like to load into a remote herkou redis db get the redis URI from the resources tab in the Heroku admin, and then pass it in as a second parameter:
./load.js tweets.json redis://redistogo:[email protected]:10771
Loading existing tweets is useful when you haven't been running earls since the beginning of an event, and you would like to load some of this historical data.