Class: Gizoogle::Webpage

Inherits:
Object
  • Object
show all
Defined in:
lib/gizoogle/webpage.rb

Overview

Translate a whole webpage into gangsta

Class Method Summary collapse

Class Method Details

.translate(url) ⇒ Object

Translate a webpage, returns translated HTML of page

Example:

>> Gizoogle::Webpage.translate('github.com')
=> <html><head>...translated html here...

Arguments:

url: (String)

15
16
17
18
19
20
21
22
# File 'lib/gizoogle/webpage.rb', line 15

def self.translate(url)
  params = { 'search' => url }
  url = URI('http://www.gizoogle.net/tranzizzle.php')
  url.query = URI.encode_www_form(params)
  body = Net::HTTP.get(url)

  body
end