Sha256: f4a0612f820978a5a7382d5559f6756f4c1325aa51b152ddefbda052f4d024f8

Contents?: true

Size: 502 Bytes

Versions: 9

Compression:

Stored size: 502 Bytes

Contents

# frozen_string_literal: true

module Fushin
  module Posts
    class Shinobi < Post
      def main_selector
        "#primary > div.inner > div > div:nth-child(3)"
      end

      def main_cleanup_selectors
        %w(script)
      end

      def attachements
        @attachements ||= doc.css("#primary > div.inner > div > div:nth-child(3) > a").map do |a|
          url = a.get("href")
          next unless url

          Models::Attachment.new url
        end.compact
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
fushin-0.4.2 lib/fushin/posts/shinobi.rb
fushin-0.4.1 lib/fushin/posts/shinobi.rb
fushin-0.4.0 lib/fushin/posts/shinobi.rb
fushin-0.3.4 lib/fushin/posts/shinobi.rb
fushin-0.3.3 lib/fushin/posts/shinobi.rb
fushin-0.3.2 lib/fushin/posts/shinobi.rb
fushin-0.3.1 lib/fushin/posts/shinobi.rb
fushin-0.3.0 lib/fushin/posts/shinobi.rb
fushin-0.2.0 lib/fushin/posts/shinobi.rb