Created
April 4, 2019 22:37
-
-
Save yomete/94d2a0948c979f97bb8227b6c5aa5bd8 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
class BdcController < ApplicationController | |
def bdcrate | |
require 'openssl' | |
doc = Nokogiri::HTML(open('https://www.abokifx.com/bdc_rate', :ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE)) | |
entries = doc.css('.lagos-market-rates') | |
rate = entries.css('table')[0].css('tr')[1].css('td')[1].text | |
@formattedrate = rate[6..8] | |
render template: 'bdc/home' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment