Sha256: 3b307e16e648718c55cb09a3773d0f811a3d4b0db7873f1d6e6d947ddcaa13ec

Contents?: true

Size: 518 Bytes

Versions: 15

Compression:

Stored size: 518 Bytes

Contents

class LinkOracle
  module Extractor
    class Meta < Base
      def type
        :meta
      end

      def title
        found = parsed_body.at_xpath("//title/text()")
        found ? [found.content] : []
      end

      def image
        get_content("//meta[contains(@name, 'thumbnail')]")
      end

      def description
        get_content("//meta[translate(
          @name,
          'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
          'abcdefghijklmnopqrstuvwxyz'
        ) = 'description']")
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
link_oracle-0.1.11 lib/link_oracle/extractor/meta.rb
link_oracle-0.1.10 lib/link_oracle/extractor/meta.rb
link_oracle-0.1.9 lib/link_oracle/extractor/meta.rb
link_oracle-0.1.8 lib/link_oracle/extractor/meta.rb
link_oracle-0.1.7 lib/link_oracle/extractor/meta.rb
link_oracle-0.1.6 lib/link_oracle/extractor/meta.rb
link_oracle-0.1.5 lib/link_oracle/extractor/meta.rb
link_oracle-0.1.4 lib/link_oracle/extractor/meta.rb
link_oracle-0.1.3 lib/link_oracle/extractor/meta.rb
link_oracle-0.1.2 lib/link_oracle/extractor/meta.rb
link_oracle-0.1.1 lib/link_oracle/extractor/meta.rb
link_oracle-0.1.0 lib/link_oracle/extractor/meta.rb
link_oracle-0.0.8 lib/link_oracle/extractor/meta.rb
link_oracle-0.0.7 lib/link_oracle/extractor/meta.rb
link_oracle-0.0.6 lib/link_oracle/extractor/meta.rb