Skip to content

Instantly share code, notes, and snippets.

@cloneko
Created March 1, 2013 15:17
Show Gist options
  • Save cloneko/5065303 to your computer and use it in GitHub Desktop.
Save cloneko/5065303 to your computer and use it in GitHub Desktop.
Xvideos Infomartion Fetcher(Thumbnail's URL / Movie Title)
require 'net/http'
module Xvideos
class Fetcher
JPHOST = 'www.xvideos.jp'
def initialize(path,host = JPHOST)
http = Net::HTTP.new(JPHOST)
@res = http.get(path).body
end
def title
@title = @res.match(/<title>(.*) - XVIDEOS.*<\/title>/)[1]
end
def thumb
@thumb = @res.match(/<img src="([^\ ]*)" .*class="thumb"/)[1]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment