Class: BrandEins::Downloader::ArchiveSite::ArchiveMagazine::MagazineArticle

Inherits:
Object
  • Object
show all
Defined in:
lib/brandeins-dl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#docObject

Returns the value of attribute doc.



225
226
227
# File 'lib/brandeins-dl.rb', line 225

def doc
  @doc
end

#urlObject

Returns the value of attribute url.



225
226
227
# File 'lib/brandeins-dl.rb', line 225

def url
  @url
end

Instance Method Details



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