Skip to content

Instantly share code, notes, and snippets.

@mchail
Created November 13, 2012 19:32
Show Gist options
  • Save mchail/4067850 to your computer and use it in GitHub Desktop.
Save mchail/4067850 to your computer and use it in GitHub Desktop.
Check google's nexus page until I can buy one
#!/usr/bin/ruby
require 'rest-client'
counter = 0
can_has_phone = false
while !can_has_phone
puts "checking... (#{counter})"
src = RestClient.get("https://play.google.com/store/devices/details?id=nexus_4_16gb")
can_has_phone = !((src =~ /coming\ soon/i) || (src =~ /sold out/i))
counter += 1
sleep 5
end
puts "YOU CAN HAZ PHONE NAO! QUICK!"
`open https://play.google.com/store/devices/details?id=nexus_4_16gb`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment