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