Class: XvideosHelper::Crawler
- Inherits:
-
Object
- Object
- XvideosHelper::Crawler
- Defined in:
- lib/xvideos_helper/crawler.rb
Instance Attribute Summary collapse
-
#movies_limit ⇒ Object
Returns the value of attribute movies_limit.
-
#tags_limit ⇒ Object
Returns the value of attribute tags_limit.
Instance Method Summary collapse
- #get_data_from(url, from) ⇒ Object
-
#initialize ⇒ Crawler
constructor
A new instance of Crawler.
Constructor Details
#initialize ⇒ Crawler
Returns a new instance of Crawler.
8 9 10 11 12 13 |
# File 'lib/xvideos_helper/crawler.rb', line 8 def initialize @domain ||= Env::XVIDES_URL_WWW @iframe_url ||= Env::XVIDES_IFRAME_URL @movies_limit ||= -1 @tags_limit ||= -1 end |
Instance Attribute Details
#movies_limit ⇒ Object
Returns the value of attribute movies_limit.
7 8 9 |
# File 'lib/xvideos_helper/crawler.rb', line 7 def movies_limit @movies_limit end |
#tags_limit ⇒ Object
Returns the value of attribute tags_limit.
7 8 9 |
# File 'lib/xvideos_helper/crawler.rb', line 7 def @tags_limit end |
Instance Method Details
#get_data_from(url, from) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/xvideos_helper/crawler.rb', line 15 def get_data_from(url,from) begin source = html(url) if from == 'movie' return parsed_movie_data(source) elsif from == 'taglist' return parsed_tag_data(source) else return {} end rescue Exception => e raise e end end |