プロジェクト

全般

プロフィール

バグ #1279 » 0001-gyazo-Twitter-Card.patch

cob odo, 2018-07-18 15:20

差分を表示:

core/plugin/photo_support/photo_support.rb
79 79

  
80 80
  # gyazo
81 81
  defimageopener('gyazo', %r<\Ahttps?://gyazo.com/[a-zA-Z0-9]+>) do |display_url|
82
    connection = HTTPClient.new
83
    page = connection.get_content(display_url)
84
    next nil if page.empty?
85
    doc = Nokogiri::HTML(page)
86
    result = doc.css('.image').first
87
    open(result.attribute('src'))
82
    img = Plugin::PhotoSupport.d250g2(display_url)
83
    open(img) if img
88 84
  end
89 85

  
90 86
  # 携帯百景
    (1-1/1)