From e9ca47451ff8f3b26d33e9e868be0ec5ab388091 Mon Sep 17 00:00:00 2001 From: cobodo Date: Wed, 18 Jul 2018 15:18:19 +0900 Subject: [PATCH] =?UTF-8?q?gyazo=E3=81=AE=E3=82=B5=E3=83=A0=E3=83=8D?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=82=92Twitter=20Card=E3=81=A7=E5=8F=96?= =?UTF-8?q?=E5=BE=97=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/plugin/photo_support/photo_support.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/core/plugin/photo_support/photo_support.rb b/core/plugin/photo_support/photo_support.rb index b5bd1725..e3622cb0 100644 --- a/core/plugin/photo_support/photo_support.rb +++ b/core/plugin/photo_support/photo_support.rb @@ -79,12 +79,8 @@ Plugin.create :photo_support do # gyazo defimageopener('gyazo', %r<\Ahttps?://gyazo.com/[a-zA-Z0-9]+>) do |display_url| - connection = HTTPClient.new - page = connection.get_content(display_url) - next nil if page.empty? - doc = Nokogiri::HTML(page) - result = doc.css('.image').first - open(result.attribute('src')) + img = Plugin::PhotoSupport.d250g2(display_url) + open(img) if img end # 携帯百景 -- 2.17.1