Skip to content

Instantly share code, notes, and snippets.

@vivien
Last active August 29, 2015 14:11
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 vivien/7535f85928558fffb11d to your computer and use it in GitHub Desktop.
Save vivien/7535f85928558fffb11d to your computer and use it in GitHub Desktop.
i3blocks bocklet to fetch the latest OpenMW version and progress percentage
[openmw]
command=curl -s https://gist.githubusercontent.com/vivien/7535f85928558fffb11d/raw/openmw.rb | ruby
interval=3600
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