Skip to content

Instantly share code, notes, and snippets.

/zippy.rb Secret

Created November 14, 2017 21:23
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 anonymous/297a653e12b4a1dff21bc46d6224ce39 to your computer and use it in GitHub Desktop.
Save anonymous/297a653e12b4a1dff21bc46d6224ce39 to your computer and use it in GitHub Desktop.
require "open-uri"
require "dentaku"
math = Dentaku::Calculator.new
url = ARGV[0].strip
page = open(url).read
chalange = page.match(/"(.*?)" \+ \((.*?)\) \+ "(.*?)"/)
parsed_content = chalange[1] + math.evaluate(chalange[2]).to_s + chalange[3]
puts "http://#{url.split("/")[2]}#{parsed_content}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment