Skip to content

Instantly share code, notes, and snippets.

@shawngraham
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shawngraham/37991abb603424d4db3b to your computer and use it in GitHub Desktop.
Save shawngraham/37991abb603424d4db3b to your computer and use it in GitHub Desktop.
steps for setting up @edsu's EARLS on Heroku;

Setting up EARLS

Earls is useful for archiving and counting URLS shared in tweets from a particular hashtag, eg., conference backchat etc. Getting it set up on Heroku (a tiered free service) is fairly straightforward. Getting it to go live requires a credit card tied to your account - but if you're using the free tier, this shouldn't be an issue. Anyway, with the help of Dan Pett I learned how to set one up. Dan set up an earls instance for #msudai.

getting ready

get a heroku account

install git

install node

install toolbelt

and go!

  • on heroku page, I created a new app called 'sg-earls'
  • on twitter's developer page I created a new app so that I could get the twitter credentials we pass to Heroku below.
  • in the terminal, the following sequence of commands:

$ git clone https://github.com/edsu/earls

$ cd earls

$ heroku login

$ heroku config:set EARLS_TRACK="#msudai" --app sg-earls

$ heroku config:set TWITTER_CONSUMER_KEY=XXX --app sg-earls

$ heroku config:set TWITTER_CONSUMER_SECRET=XXX --app sg-earls

$ heroku config:set TWITTER_ACCESS_TOKEN=XXX --app sg-earls

$ heroku config:set TWITTER_ACCESS_TOKEN_SECRET=XXX --app sg-earls

$ git init

$ heroku git:remote -a sg-earls

$ git add .

$ git commit -am "do it"

$ git push heroku master

...at this point, once you're back to the prompt, the url for your app will be displayed. Of course, if you haven't tied a credit card to your account, it won't be live. But otherwise, pretty easy-peasy. Thanks Dan & Ed!

Additional packages on Heroku (via Dan Pett)

Install a logging package so you can see where it has gone wrong:

$ heroku addons:create papertrail:choklad

Install Redistogo from Heroku addons.

$ heroku addons:create redistogo:nano

Getting data into Heroku from twarc archive

To get the data up into your instance I found a few dependencies for Node.js needed to be installed on my OSX Yosemite machine:

$ npm install async

$ npm install redis

$ npm install underscore

$ npm install cheerio

$ npm install express

$ npm install twitter

$ npm install request

$ npm install socket.io

For Twarc I needed to have this installed:

$ pip install pyopenssl ndg-httpsclient pyasn1

Which enabled SSL requests to work.

@edsu
Copy link

edsu commented Aug 18, 2015

Might be worth adding this to the earls README.md perhaps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment