Skip to content

Instantly share code, notes, and snippets.

@muffinista
Created January 9, 2014 01:28
Show Gist options
  • Save muffinista/8327843 to your computer and use it in GitHub Desktop.
Save muffinista/8327843 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler/setup'
require 'chatterbot/dsl'
require 'spacejam'
consumer_key 'key'
consumer_secret 'secret'
secret 'secret'
token 'token'
check_url = "http://www2.warnerbros.com/spacejam/movie/jam.htm"
check_string = "<title>Space Jam</title>"
uptime_messages = [
"Hooray! Space Jam is still online!",
"It's #{Time.now.year} and the Space Jam website is still online",
"In case you were worried, Space Jam is still online",
"Looks like the Space Jam website is still there",
"Yes",
"Yep",
"Still Kickin",
"The Space Jam website is still online",
"Still Online"
]
downtime_messages = [
"Hmm, looks like Space Jam isn't online. Hopefully it's a fluke ;("
]
x = Spacejam::HTTPCheck.new(check_url)
result = if x.online?
uptime_messages
else
downtime_messages
end.sample
result << " (#{Time.now.utc})"
tweet result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment