Skip to content

Instantly share code, notes, and snippets.

@raws
Last active December 19, 2015 08:49
Show Gist options
  • Save raws/5928654 to your computer and use it in GitHub Desktop.
Save raws/5928654 to your computer and use it in GitHub Desktop.
Ruby script that throws up a Notification Center alert when Picroma user registrations open up so I can buy and download Cube World
#!/usr/bin/env ruby
require 'http'
require 'logger'
require 'terminal-notifier'
logger = Logger.new(STDOUT)
loop do
body = Http.get('https://picroma.com/account/create')
if body !~ /user registrations are currently disabled/i
logger.info 'Picroma user registrations are open!'
TerminalNotifier.notify 'Click here to register!', title: 'Picroma registrations are open!', open: 'https://picroma.com/account/create'
exit
end
logger.info 'Picroma user registrations are still closed :('
sleep 60
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment