Last active
December 4, 2015 01:58
-
-
Save moskyb/2cd6c330db5171d5f83e to your computer and use it in GitHub Desktop.
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
def mystery(mech, invoice_rel) | |
page = mech.get("https://something.flickelectric.co.nz/" + invoice_rel) | |
foo = page.search('dl[id="invoice_details"]').to_s.include?("actual") | |
bar = page.search('tfoot[class~="invoice-totals"]').children | |
baz = bar.text.gsub(/\s+/, "") | |
dollar = -1 | |
while baz[dollar] != '$' | |
dollar -= 1 | |
end | |
bing = (totals [dollar + 1..-1].to_f != 0.00) && foo | |
return bing | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment