Class: XvideosHelper::Client
- Inherits:
-
Object
- Object
- XvideosHelper::Client
- Defined in:
- lib/xvideos_helper/client.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#tag_url ⇒ Object
Returns the value of attribute tag_url.
Instance Method Summary collapse
-
#initialize ⇒ Client
constructor
A new instance of Client.
- #movies_limit=(limit) ⇒ Object
-
#movies_of(target) ⇒ Object
get movie information according to target.
-
#tag_data_lists ⇒ Object
tag’s url lists.
- #tags_limit=(limit) ⇒ Object
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
8 9 10 11 12 |
# File 'lib/xvideos_helper/client.rb', line 8 def initialize @crawler = XvideosHelper::Crawler.new @domain ||= Env::XVIDES_URL_WWW @tag_url ||= Env::XVIDES_TAG_URL end |
Instance Attribute Details
#domain ⇒ Object
Returns the value of attribute domain.
7 8 9 |
# File 'lib/xvideos_helper/client.rb', line 7 def domain @domain end |
#tag_url ⇒ Object
Returns the value of attribute tag_url.
7 8 9 |
# File 'lib/xvideos_helper/client.rb', line 7 def tag_url @tag_url end |
Instance Method Details
#movies_limit=(limit) ⇒ Object
32 33 34 |
# File 'lib/xvideos_helper/client.rb', line 32 def movies_limit=(limit) @crawler.movies_limit = limit end |
#movies_of(target) ⇒ Object
get movie information according to target
15 16 17 18 19 20 21 |
# File 'lib/xvideos_helper/client.rb', line 15 def movies_of(target) begin return @crawler.get_data_from(target,'movie') rescue Exception => e raise e end end |
#tag_data_lists ⇒ Object
tag’s url lists
24 25 26 27 28 29 30 |
# File 'lib/xvideos_helper/client.rb', line 24 def tag_data_lists begin return @crawler.get_data_from(@tag_url,'taglist') rescue Exception => e raise e end end |
#tags_limit=(limit) ⇒ Object
36 37 38 |
# File 'lib/xvideos_helper/client.rb', line 36 def (limit) @crawler. = limit end |