Sha256: 87b25e461e41c964d0fb499a47b38af5ca4dee11a122911dace24b302b292470

Contents?: true

Size: 525 Bytes

Versions: 36

Compression:

Stored size: 525 Bytes

Contents

# frozen_string_literal: true

module Onebox
  module Engine
    class DoubanOnebox
      include Engine
      include LayoutSupport
      include HTML

      matches_regexp(/^(https?:\/\/)?([\da-z\.-]+)(douban.com\/)(.)+\/?$/)

      private

      def data
        {
          link: link,
          title: raw.css('title').text.gsub("\n", '').strip(),
          image: raw.css('img[rel*="v:"]').first['src'],
          description: raw.css('meta[name=description]').first['content'],
        }
      end

    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
onebox-1.9.25 lib/onebox/engine/douban_onebox.rb
onebox-1.9.24 lib/onebox/engine/douban_onebox.rb
onebox-1.9.23 lib/onebox/engine/douban_onebox.rb
onebox-1.9.22 lib/onebox/engine/douban_onebox.rb
onebox-1.9.21 lib/onebox/engine/douban_onebox.rb
onebox-1.9.20 lib/onebox/engine/douban_onebox.rb
onebox-1.9.19 lib/onebox/engine/douban_onebox.rb
onebox-1.9.18 lib/onebox/engine/douban_onebox.rb
onebox-1.9.17 lib/onebox/engine/douban_onebox.rb
onebox-1.9.16 lib/onebox/engine/douban_onebox.rb
onebox-1.9.15 lib/onebox/engine/douban_onebox.rb
onebox-1.9.14 lib/onebox/engine/douban_onebox.rb
onebox-1.9.13 lib/onebox/engine/douban_onebox.rb
onebox-1.9.12 lib/onebox/engine/douban_onebox.rb
onebox-1.9.11 lib/onebox/engine/douban_onebox.rb
onebox-1.9.10 lib/onebox/engine/douban_onebox.rb
onebox-1.9.9 lib/onebox/engine/douban_onebox.rb
onebox-1.9.8 lib/onebox/engine/douban_onebox.rb
onebox-1.9.7 lib/onebox/engine/douban_onebox.rb
onebox-1.9.6 lib/onebox/engine/douban_onebox.rb