Class: PictureFrom::Crawlers::FacebookCrawler::SearchPage
- Inherits:
-
BaseCrawler::Page
- Object
- BaseCrawler::Page
- PictureFrom::Crawlers::FacebookCrawler::SearchPage
- Defined in:
- lib/picture_from/crawlers/facebook_crawler.rb
Instance Method Summary collapse
-
#initialize(user_info) ⇒ SearchPage
constructor
A new instance of SearchPage.
- #usernames ⇒ Object
Methods inherited from BaseCrawler::Page
Constructor Details
#initialize(user_info) ⇒ SearchPage
Returns a new instance of SearchPage.
11 12 13 |
# File 'lib/picture_from/crawlers/facebook_crawler.rb', line 11 def initialize(user_info) @page = open_url("https://www.facebook.com/search.php?q=#{user_info}") end |
Instance Method Details
#usernames ⇒ Object
15 16 17 |
# File 'lib/picture_from/crawlers/facebook_crawler.rb', line 15 def usernames results.map { |result| username_from_url(result['href']) }.compact end |