Class: BrandEins::Downloader::ArchiveSite::ArchiveMagazine::MagazineArticle
- Inherits:
-
Object
- Object
- BrandEins::Downloader::ArchiveSite::ArchiveMagazine::MagazineArticle
- Defined in:
- lib/brandeins-dl.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.
227 228 229 230 231 |
# File 'lib/brandeins-dl.rb', line 227 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.
225 226 227 |
# File 'lib/brandeins-dl.rb', line 225 def doc @doc end |
#url ⇒ Object
Returns the value of attribute url.
225 226 227 |
# File 'lib/brandeins-dl.rb', line 225 def url @url end |
Instance Method Details
#get_pdf_link ⇒ Object
233 234 235 236 237 238 239 240 |
# File 'lib/brandeins-dl.rb', line 233 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 |