module Xclient::Xvideos
Public Class Methods
parse(url)
click to toggle source
# File lib/xclient/xvideos.rb, line 3 def self.parse(url) begin @doc = Nokogiri::HTML(open(url)) Client.new( title: title, thumbs: thumbs, tags: tags, embed: embed, host: Xclient::XVIDEOS_HOST, url: url ) rescue raise PasserError, "passer error" end end
Private Class Methods
embed()
click to toggle source
# File lib/xclient/xvideos.rb, line 33 def self.embed @doc.css('#tabEmbed > input').first.attr :value end
thumbs()
click to toggle source
# File lib/xclient/xvideos.rb, line 24 def self.thumbs thumb = [] embed_attrs = @doc.css('embed').first.attr('flashvars').split('&') main_thumb_index = embed_attrs.index{|s| s.include?("url_bigthumb=")} main_thumb = embed_attrs[main_thumb_index].split("=").last thumb << main_thumb end
title()
click to toggle source
# File lib/xclient/xvideos.rb, line 20 def self.title @doc.css('#main > h2').first.children.first.text.strip end