Skip to content

Instantly share code, notes, and snippets.

@koehler8
Created November 5, 2014 17:19
Show Gist options
  • Save koehler8/26873c9356c8c4a975cc to your computer and use it in GitHub Desktop.
Save koehler8/26873c9356c8c4a975cc to your computer and use it in GitHub Desktop.
while true
sleep(10)
response = RestClient.get('https://play.google.com/store/devices/details/Nexus_6_64GB_Midnight_Blue?id=nexus_6_blue_64gb')
alert = "#{Time.now()} BLUE 64"
if response.include? 'We are out of inventory. Please check back soon.'
alert += ' STILL OUT...'
else
alert += '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AVAILABLE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
end
puts alert
sleep(10)
response = RestClient.get('https://play.google.com/store/devices/details/Nexus_6_64GB_Cloud_White?id=nexus_6_white_64gb')
alert = "#{Time.now()} WHITE 64"
if response.include? 'We are out of inventory. Please check back soon.'
alert += ' STILL OUT...'
else
alert += '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AVAILABLE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
end
puts alert
sleep(10)
response = RestClient.get('https://play.google.com/store/devices/details/Nexus_6_32GB_Midnight_Blue?id=nexus_6_blue_32gb')
alert = "#{Time.now()} BLUE 32"
if response.include? 'We are out of inventory. Please check back soon.'
alert += ' STILL OUT...'
else
alert += '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AVAILABLE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
end
puts alert
sleep(10)
response = RestClient.get('https://play.google.com/store/devices/details/Nexus_6_32GB_Cloud_White?id=nexus_6_white_32gb')
alert = "#{Time.now()} WHITE 32"
if response.include? 'We are out of inventory. Please check back soon.'
alert += ' STILL OUT...'
else
alert += '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AVAILABLE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
end
puts alert
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment