Skip to content

Instantly share code, notes, and snippets.

@yomete
Created April 4, 2019 22:36
Show Gist options
  • Save yomete/71ad01f08646bda3a9a171b2bdecbc47 to your computer and use it in GitHub Desktop.
Save yomete/71ad01f08646bda3a9a171b2bdecbc47 to your computer and use it in GitHub Desktop.
class ParallelController < ApplicationController
def parallelrate
require 'openssl'
doc = Nokogiri::HTML(open('https://www.abokifx.com/', :ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE))
entries = doc.css('.lagos-market-rates-inner')
rate = entries.css('table')[0].css('tr')[1].css('td')[1].text
@formattedrate = rate[6..8]
render template: 'parallel/home'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment