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.50 lib/onebox/engine/douban_onebox.rb
onebox-1.5.49 lib/onebox/engine/douban_onebox.rb
onebox-1.5.48 lib/onebox/engine/douban_onebox.rb
onebox-1.5.47 lib/onebox/engine/douban_onebox.rb
onebox-1.5.45 lib/onebox/engine/douban_onebox.rb
onebox-1.5.44 lib/onebox/engine/douban_onebox.rb
onebox-1.5.43 lib/onebox/engine/douban_onebox.rb
onebox-1.5.42 lib/onebox/engine/douban_onebox.rb
onebox-1.5.41 lib/onebox/engine/douban_onebox.rb
onebox-1.5.40 lib/onebox/engine/douban_onebox.rb
onebox-1.5.39 lib/onebox/engine/douban_onebox.rb
onebox-1.5.38 lib/onebox/engine/douban_onebox.rb
onebox-1.5.37 lib/onebox/engine/douban_onebox.rb
onebox-1.5.36 lib/onebox/engine/douban_onebox.rb
onebox-1.5.35 lib/onebox/engine/douban_onebox.rb
onebox-1.5.34 lib/onebox/engine/douban_onebox.rb
onebox-1.5.33 lib/onebox/engine/douban_onebox.rb
onebox-1.5.32 lib/onebox/engine/douban_onebox.rb
onebox-1.5.31 lib/onebox/engine/douban_onebox.rb
onebox-1.5.30 lib/onebox/engine/douban_onebox.rb