get sale info champions and skins include RP price (from lolking)
require "rubygems"
require "json"
require "open-uri"
require "nokogiri"
def salechamp
doc = Nokogiri::HTML(open("http://www.lolking.net/"))
chn = "Champion sales is"
nodeset = doc.css("#champion-sales div").each do |str|
chn = chn + " " + str.inner_text
if str.inner_text.strip =~ /^[0-9]+$/ then
chn = chn + "RP"
end
end
puts chn
#return chn
end
def saleskin
doc = Nokogiri::HTML(open("http://www.lolking.net/"))
chn = "Skin sales is"
nodeset = doc.css("#skin-sales div").each do |str|
chn = chn + " " + str.inner_text
if str.inner_text.strip =~ /^[0-9]+$/ then
chn = chn + "RP"
end
end
puts chn
#return chn
end
salechamp
saleskin