Created
March 1, 2013 15:17
-
-
Save cloneko/5065303 to your computer and use it in GitHub Desktop.
Xvideos Infomartion Fetcher(Thumbnail's URL / Movie Title)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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