Last active
August 29, 2015 14:00
-
-
Save haeky/11360960 to your computer and use it in GitHub Desktop.
Checking if the new Pebble Steel is out.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
require 'watir' | |
require 'open-uri' | |
require 'pry' | |
class Tweetbot | |
def parse_website | |
browser = Watir::Browser.new :phantomjs | |
browser.goto('https://getpebble.com/checkout') | |
document = Nokogiri::HTML.parse(browser.html) | |
div = document.css('div.steel_black') | |
puts 'Pebble Steel is now out <3' unless div.attr('class').value.include?('backordered') | |
end | |
end | |
bot = Tweetbot.new | |
bot.parse_website |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment