Sha256: e537ecc53448f574561b1d3b4cd630de1e5ee3e4b72c4bed4909bf364cce20d9

Contents?: true

Size: 501 Bytes

Versions: 64

Compression:

Stored size: 501 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

64 entries across 64 versions & 1 rubygems

Version Path
onebox-1.5.29 lib/onebox/engine/douban_onebox.rb
onebox-1.5.28 lib/onebox/engine/douban_onebox.rb
onebox-1.5.27 lib/onebox/engine/douban_onebox.rb
onebox-1.5.26 lib/onebox/engine/douban_onebox.rb
onebox-1.5.25 lib/onebox/engine/douban_onebox.rb
onebox-1.5.24 lib/onebox/engine/douban_onebox.rb
onebox-1.5.23 lib/onebox/engine/douban_onebox.rb
onebox-1.5.22 lib/onebox/engine/douban_onebox.rb
onebox-1.5.21 lib/onebox/engine/douban_onebox.rb
onebox-1.5.20 lib/onebox/engine/douban_onebox.rb
onebox-1.5.19 lib/onebox/engine/douban_onebox.rb
onebox-1.5.18 lib/onebox/engine/douban_onebox.rb
onebox-1.5.17 lib/onebox/engine/douban_onebox.rb
onebox-1.5.16 lib/onebox/engine/douban_onebox.rb
onebox-1.5.14 lib/onebox/engine/douban_onebox.rb
onebox-1.5.13 lib/onebox/engine/douban_onebox.rb
onebox-1.5.12 lib/onebox/engine/douban_onebox.rb
onebox-1.5.11 lib/onebox/engine/douban_onebox.rb
onebox-1.5.10 lib/onebox/engine/douban_onebox.rb
onebox-1.5.9 lib/onebox/engine/douban_onebox.rb