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.7.3 lib/onebox/engine/douban_onebox.rb
onebox-1.7.2 lib/onebox/engine/douban_onebox.rb
onebox-1.7.1 lib/onebox/engine/douban_onebox.rb
onebox-1.7.0 lib/onebox/engine/douban_onebox.rb
onebox-1.6.9 lib/onebox/engine/douban_onebox.rb
onebox-1.6.8 lib/onebox/engine/douban_onebox.rb
onebox-1.6.7 lib/onebox/engine/douban_onebox.rb
onebox-1.6.6 lib/onebox/engine/douban_onebox.rb
onebox-1.6.5 lib/onebox/engine/douban_onebox.rb
onebox-1.6.4 lib/onebox/engine/douban_onebox.rb
onebox-1.6.3 lib/onebox/engine/douban_onebox.rb
onebox-1.6.2 lib/onebox/engine/douban_onebox.rb
onebox-1.6.1 lib/onebox/engine/douban_onebox.rb
onebox-1.6.0 lib/onebox/engine/douban_onebox.rb
onebox-1.5.65 lib/onebox/engine/douban_onebox.rb
onebox-1.5.64 lib/onebox/engine/douban_onebox.rb
onebox-1.5.63 lib/onebox/engine/douban_onebox.rb
onebox-1.5.62 lib/onebox/engine/douban_onebox.rb
onebox-1.5.61 lib/onebox/engine/douban_onebox.rb
onebox-1.5.60 lib/onebox/engine/douban_onebox.rb