Send Twitter search results to a HipChat room in realtime
Ruby Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
.gitignore
.ruby-version
Gemfile
Gemfile.lock
Procfile
README.md
Rakefile
add_keywords.sh
add_users.sh
backup_heroku_config.sh
config.rb
config.sample.yml
deploy
twitter_search.rb
twitter_stream.rb

README.md

hiptweets

Print tweets matching specific search terms to a HipChat room

Designed to run on Heroku for free.

Configuration

Locally you copy config.sample.yml to config.yml and fill things in.

On Heroku, set the following ENV vars:

  • TWITTER_ACCESS_KEY
  • TWITTER_SECRET_KEY
  • TWITTER_CONSUMER_KEY
  • TWITTER_CONSUMER_SECRET
  • HIPCHAT_API_TOKEN
  • HIPCHAT_ROOM

And what you actually want to search for:

  • HIPTWEET_SEARCH -- comma-delimited string like vhx,foo,bar
  • HIPTWEET_USER_IDS -- comma-delimited string of Twitter user IDs via @username -> id lookup tool

e.g.

heroku config:add TWITTER_ACCESS_KEY="" TWITTER_SECRET_KEY="" TWITTER_CONSUMER_KEY="" TWITTER_CONSUMER_SECRET=""
heroku config:add HIPCHAT_API_TOKEN="" HIPCHAT_ROOM=""
heroku config:add HIPTWEET_SEARCH="vhx.tv,foobar"
heroku config:add HIPTWEET_USER_IDS="1234583,9876522"

HipChat room can be either name or ID

Running locally

bundle install
bundle exec rake twitter:stream

Or how it's run on Heroku, to test the Procfile:

gem install heroku
foreman start

Running on Heroku

heroku create hiptweets-jamiew --stack=cedar
heroku config:add TWITTER_ACCESS_KEY="" TWITTER_SECRET_KEY="" TWITTER_CONSUMER_KEY="" TWITTER_CONSUMER_SECRET=""
heroku config:add HIPCHAT_API_TOKEN="" HIPCHAT_ROOM=""
heroku config:add HIPTWEET_SEARCH="vhx.tv,foobar"
heroku config:add HIPTWEET_USER_IDS="1234583,9876522"
git push heroku master
heroku scale stream=1

You can use heroku logs -t to watch output

Notes

  • TwitterSearch is a work-in-progress
  • Request: a node.js version that runs inside Hubot, and also responds to "@hubot search twitter 'my string'"

Authors

Copyright

All source code made freely available under an MIT License

Contributing

  • Fork the project
  • Create a new branch for your feature or bugfix
  • Send a pull request

Following the contributor-friendly practices of Rubinius and FAT Lab, anyone who submits a patch which is accepted is granted both commit and credit/attribution bits.