A simple ruby script to notify you of impending availability of pax badges by monitoring the @offical_pax Twitter and paxsite.com!
Run this as a cron job when you know badges will be coming soon to get notified as soon as possible when badges are officially mentioned by PAX!
This script is designed to be run as a scheduled cron job!
- Run
bundle install
- Create a Twitter App, and a Twilio account
- Set up a .env file containing info for Twitter {API_KEY, API_SECRET, ACCESS_TOKEN, and ACCESS_SECRET}, Twilio {ACCOUNT_SID and ACCESS_TOKEN}, and your telephone numbers {MY_NUMBER and TWILIO_NUMBER}
- Run
ruby pax-badger.rb {expo} {interval}
to run the script.- {expo} can be
east
,prime
,south
, oraus
- {interval} is the interval in seconds between scheduled runs of the script
- For example, if you schedule the script to run every half hour to check for PAX East badges, run
ruby pax-badger.rb east 1800
- {expo} can be
- NOTE: you may have to cancel the cron job after initial notification waves to avoid more notifications.
- To run the script not in the context of a cron job (single run), you can just use
ruby pax-badger.rb {expo}
.
- You can schedule the script to run on Heroku using the Heroku Scheduler!
- see: http://buncha-nerds.com/blog/2015/10/13/ruby-scripts-heroku/
ruby >= 2.1.0
gem 'nogokiri'
to parse htmlgem 'twitter'
to parse tweetsgem 'dotenv'
to keep sensitive information safegem 'twilio-ruby'
to send SMS notifications
Alex Wong
MIT