Last active
May 24, 2017 07:37
-
-
Save wrtsprt/9ec6519a866035ab9982b02005ac00b0 to your computer and use it in GitHub Desktop.
BitBar plugin to indicate if DJ Trump was impeached yet
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
#!/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