Sha256: 87b25e461e41c964d0fb499a47b38af5ca4dee11a122911dace24b302b292470

Contents?: true

Size: 525 Bytes

Versions: 36

Compression:

Stored size: 525 Bytes

Contents

# frozen_string_literal: true

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

36 entries across 36 versions & 1 rubygems

Version Path
onebox-1.9.5 lib/onebox/engine/douban_onebox.rb
onebox-1.9.4 lib/onebox/engine/douban_onebox.rb
onebox-1.9.3 lib/onebox/engine/douban_onebox.rb
onebox-1.9.2 lib/onebox/engine/douban_onebox.rb
onebox-1.9.1 lib/onebox/engine/douban_onebox.rb
onebox-1.9.0 lib/onebox/engine/douban_onebox.rb
onebox-1.8.99 lib/onebox/engine/douban_onebox.rb
onebox-1.8.98 lib/onebox/engine/douban_onebox.rb
onebox-1.8.97 lib/onebox/engine/douban_onebox.rb
onebox-1.8.96 lib/onebox/engine/douban_onebox.rb
onebox-1.8.95 lib/onebox/engine/douban_onebox.rb
onebox-1.8.94 lib/onebox/engine/douban_onebox.rb
onebox-1.8.93 lib/onebox/engine/douban_onebox.rb
onebox-1.8.92 lib/onebox/engine/douban_onebox.rb
onebox-1.8.91 lib/onebox/engine/douban_onebox.rb
onebox-1.8.90 lib/onebox/engine/douban_onebox.rb