Skip to content

Instantly share code, notes, and snippets.

@wrtsprt
Last active May 24, 2017 07:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wrtsprt/9ec6519a866035ab9982b02005ac00b0 to your computer and use it in GitHub Desktop.
Save wrtsprt/9ec6519a866035ab9982b02005ac00b0 to your computer and use it in GitHub Desktop.
BitBar plugin to indicate if DJ Trump was impeached yet
#!/usr/bin/ruby
#
# <bitbar.title>Is Trump Impeached Yet?</bitbar.title>
# <bitbar.version>v0.1</bitbar.version>
# <bitbar.author>Raphael H. Doehring</bitbar.author>
# <bitbar.author.github>wrtsprt</bitbar.author.github>
# <bitbar.desc>Plugin polling http://istrumpimpeachedyet.com to check if the thumbgs-down image is there</bitbar.desc>
# <bitbar.dependencies>ruby</bitbar.dependencies>
# <bitbar.abouturl>https://gist.github.com/wrtsprt/9ec6519a866035ab9982b02005ac00b0</bitbar.abouturl>
require 'open-uri'
def i_can_haz_internet?
begin
true if open("http://istrumpimpeachedyet.com")
rescue
false
end
end
if i_can_haz_internet?
content = open('http://istrumpimpeachedyet.com').read
if content.match(/fa-thumbs-down/)
puts "🥕🤡"
else
puts "🎉"
end
else
puts "⏳"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment