Advertisement
Shiny_

Untitled

May 8th, 2014
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.34 KB | None | 0 0
  1. class BashOrgPL
  2.     def self.RandomQuote
  3.         GetQuote("random")
  4.     end
  5. private
  6.     def self.GetQuote(quote)
  7.         result = BashOrgPLRequest(quote)
  8.         result.first.text
  9.     end
  10.    
  11.     def self.BashOrgPLRequest(request)
  12.         result = Nokogiri::HTML(open("http://bash.org.pl/#{request}"))
  13.         result.xpath("//div[@class = 'quote post-content post-body']")
  14.     end
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement