Last active
August 29, 2015 14:11
-
-
Save vivien/7535f85928558fffb11d to your computer and use it in GitHub Desktop.
i3blocks bocklet to fetch the latest OpenMW version and progress percentage
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
[openmw] | |
command=curl -s https://gist.githubusercontent.com/vivien/7535f85928558fffb11d/raw/openmw.rb | ruby | |
interval=3600 |
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 "wombat" | |
# Scrap the OpenMW *first* version | |
data = Wombat.crawl do | |
base_url "https://bugs.openmw.org" | |
path "/projects/openmw/roadmap" | |
version css: "h3.version" | |
percent css: "p.percent" | |
end | |
version = data["version"].split("-")[1] | |
percent = data["percent"].chop.to_i | |
# Print full text | |
puts "OpenMW #{ version } (#{ percent }%)" | |
# Print short text | |
puts "#{ version } @ #{ percent }%" | |
# Urgent? | |
percent > 90 and exit 33 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment