Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class BashOrgPL
- def self.RandomQuote
- GetQuote("random")
- end
- private
- def self.GetQuote(quote)
- result = BashOrgPLRequest(quote)
- result.first.text
- end
- def self.BashOrgPLRequest(request)
- result = Nokogiri::HTML(open("http://bash.org.pl/#{request}"))
- result.xpath("//div[@class = 'quote post-content post-body']")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement