Skip to content

edsu/earls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. install redis and node
  2. git clone https://github.com/edsu/earls
  3. cd earls
  4. npm install
  5. set Twitter credentials in environment: TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET, TWITTER_ACCESS_TOKEN, TWITTER_ACCESS_TOKEN_SECRET
  6. ./earls.js '#c4l15'

Heroku

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 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

Loading

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:YOURPASSWORDHERE@mummichog.redistogo.com: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.

Archiving

Once an event is over you can create a static snapshot very easily using wget, and host it yourself or create a permanent redirect to a Github Pages site.

For example if you had an earls instance running at http://inkdroid.org/pda2015/ you could:

wget --page-requisites --no-host-directories --cut-dirs 1 http://inkdroid.org/pda2015/
git init 
git add *
git commit -m 'snapshot of earls instance' -a
git remote add origin git@github.com:edsu/pda2015.git
git checkout -b gh-pages
git push origin gh-pages
# goto http://edsu.github.io/pda2015/

About

display urls being tweeted with an event hashtag

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages