Class: BrandEins::Downloader::ArchiveSite::ArchiveMagazine::MagazineArticle
- Inherits:
-
Object
- Object
- BrandEins::Downloader::ArchiveSite::ArchiveMagazine::MagazineArticle
- Defined in:
- lib/brandeins.rb
Instance Attribute Summary collapse
-
#doc ⇒ Object
Returns the value of attribute doc.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #get_pdf_link ⇒ Object
-
#initialize(url) ⇒ MagazineArticle
constructor
A new instance of MagazineArticle.
Constructor Details
#initialize(url) ⇒ MagazineArticle
Returns a new instance of MagazineArticle.
235 236 237 238 239 |
# File 'lib/brandeins.rb', line 235 def initialize(url) puts "Parsing Article: #{url}" @url = url @doc = Nokogiri::HTML(open(url)) end |
Instance Attribute Details
#doc ⇒ Object
Returns the value of attribute doc.
233 234 235 |
# File 'lib/brandeins.rb', line 233 def doc @doc end |
#url ⇒ Object
Returns the value of attribute url.
233 234 235 |
# File 'lib/brandeins.rb', line 233 def url @url end |
Instance Method Details
#get_pdf_link ⇒ Object
241 242 243 244 245 246 247 248 |
# File 'lib/brandeins.rb', line 241 def get_pdf_link link = @doc.css("div#sidebar ul li#downloaden a") if link[0].nil? then return nil else href = link[0]['href'] end end |