Sha256: f2f3934b8e9f1b8674a5511bff8953db5eefea4e54c4d11d9cccc3e308bc5cae
Contents?: true
Size: 762 Bytes
Versions: 5
Compression:
Stored size: 762 Bytes
Contents
require 'service' module DiffNews class NZZ < Service def initialize url super url end def self.provider 'nzz.ch' end def self.base_url 'https://www.nzz.ch/' end def self.valid_url /^https?:\/\/(www.)?nzz.ch/ end private def title normalize_text(strip_html(@doc.css(".title__name").first)) rescue '' end def teaser normalize_text(strip_html(@doc.css(".leadtext").first)) rescue '' end def text content = @doc.css("article.content").first content.css('script').remove content.css('.inlinePoll').remove normalize_text(strip_html(content)) rescue '' end register_service end end
Version data entries
5 entries across 5 versions & 1 rubygems