Class: PictureFrom::Crawlers::TwitterCrawler::ProfilePage

Inherits:
BaseCrawler::Page show all
Defined in:
lib/picture_from/crawlers/twitter_crawler.rb

Instance Method Summary collapse

Methods inherited from BaseCrawler::Page

#open_url

Constructor Details

#initialize(username) ⇒ ProfilePage

Returns a new instance of ProfilePage.



11
12
13
# File 'lib/picture_from/crawlers/twitter_crawler.rb', line 11

def initialize(username)
  @page = open_url("https://twitter.com/#{username}")
end

Instance Method Details

#avatar_imageObject



15
16
17
# File 'lib/picture_from/crawlers/twitter_crawler.rb', line 15

def avatar_image
  @page.css('.ProfileAvatar-image').first['src'] if @page
end