Sha256: 1aca8b4ead989dc46131f59df245a94620b9bf4aeb781aeded9e4fa9dae9fb3c

Contents?: true

Size: 510 Bytes

Versions: 44

Compression:

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

44 entries across 44 versions & 1 rubygems

Version Path
onebox-1.8.68 lib/onebox/engine/douban_onebox.rb
onebox-1.8.67 lib/onebox/engine/douban_onebox.rb
onebox-1.8.66 lib/onebox/engine/douban_onebox.rb
onebox-1.8.65 lib/onebox/engine/douban_onebox.rb
onebox-1.8.64 lib/onebox/engine/douban_onebox.rb
onebox-1.8.63 lib/onebox/engine/douban_onebox.rb
onebox-1.8.62 lib/onebox/engine/douban_onebox.rb
onebox-1.8.61 lib/onebox/engine/douban_onebox.rb
onebox-1.8.60 lib/onebox/engine/douban_onebox.rb
onebox-1.8.59 lib/onebox/engine/douban_onebox.rb
onebox-1.8.58 lib/onebox/engine/douban_onebox.rb
onebox-1.8.57 lib/onebox/engine/douban_onebox.rb
onebox-1.8.55 lib/onebox/engine/douban_onebox.rb
onebox-1.8.54 lib/onebox/engine/douban_onebox.rb
onebox-1.8.53 lib/onebox/engine/douban_onebox.rb
onebox-1.8.52 lib/onebox/engine/douban_onebox.rb
onebox-1.8.51 lib/onebox/engine/douban_onebox.rb
onebox-1.8.50 lib/onebox/engine/douban_onebox.rb
onebox-1.8.49 lib/onebox/engine/douban_onebox.rb
onebox-1.8.48 lib/onebox/engine/douban_onebox.rb