Sha256: 73a26121b8cc013b4690af59d08c50abd6830c739962f1efbc2c7ae5038fa086

Contents?: true

Size: 509 Bytes

Versions: 29

Compression:

Stored size: 509 Bytes

Contents

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

29 entries across 29 versions & 1 rubygems

Version Path
onebox-1.8.22 lib/onebox/engine/douban_onebox.rb
onebox-1.8.21 lib/onebox/engine/douban_onebox.rb
onebox-1.8.20 lib/onebox/engine/douban_onebox.rb
onebox-1.8.19 lib/onebox/engine/douban_onebox.rb
onebox-1.8.18 lib/onebox/engine/douban_onebox.rb
onebox-1.8.17 lib/onebox/engine/douban_onebox.rb
onebox-1.8.16 lib/onebox/engine/douban_onebox.rb
onebox-1.8.15 lib/onebox/engine/douban_onebox.rb
onebox-1.8.14 lib/onebox/engine/douban_onebox.rb
onebox-1.8.13 lib/onebox/engine/douban_onebox.rb
onebox-1.8.12 lib/onebox/engine/douban_onebox.rb
onebox-1.8.11 lib/onebox/engine/douban_onebox.rb
onebox-1.8.10 lib/onebox/engine/douban_onebox.rb
onebox-1.8.9 lib/onebox/engine/douban_onebox.rb
onebox-1.8.8 lib/onebox/engine/douban_onebox.rb
onebox-1.8.7 lib/onebox/engine/douban_onebox.rb
onebox-1.8.6 lib/onebox/engine/douban_onebox.rb
onebox-1.8.5 lib/onebox/engine/douban_onebox.rb
onebox-1.8.4 lib/onebox/engine/douban_onebox.rb
onebox-1.8.3 lib/onebox/engine/douban_onebox.rb