/get_getchef_bot

Unofficial informations of getchef cookbook updates.

Primary LanguageRuby

get getchef

Unofficial Getchef community cookbook information from barkshelf api.

The informations are published to https://twitter.com/getgetchef

Feature

  • Tweet new cookbook name and version.

Steps

perform every 10 minutes following

  1. create a staging list from Berkshelf API.
  2. compare between the staging list and a current list.
  3. tweet nothing but the current list.
  4. save the staging list as the current list.

Plartforms

Modules

  • Redis
  • Rake
  • Sidekiq
  • Twitter
  • Heroku Scheduler

Deploy

Tweet your own twiiter account.

What it is prepared

  • heroku account
  • Twitter OAUTH Token(Writeable)

Create app and add Heroku addons

heroku create
heroku addons:add redistogo:nano
heroku addons:add scheduler:standard

Add configrations as ENV

heroku config:add TWITTER_CONSUMER_KEY="YOUR_CONSUMER_KEY"
heroku config:add TWITTER_CONSUMER_SECRET="YOUR_CONSUMER_SECRET"
heroku config:add TWITTER_OAUTH_TOKEN="YOUR_OAUTH_TOKEN"
heroku config:add TWITTER_OAUTH_TOKEN_SECRET="YOUR_OAUTH_TOKEN_SECRET"

deploy to heroku and up worker dynos

git push heroku master
heroku ps:scale sidekiq=1

Add job to Heroku Scheduler

Add task rake perform:heroku at web console.

test

Connect your redis and use spop current_sets to remove one cookbook. Wait for tweet about deleted cookbook as new cookbook. Or manualy heroku run rake perform:heroku.

Author

LICENSE

MIT https://github.com/higanworks/LICENSES/tree/master/MIT