[BACK]Return to patch-core_plugin_photo__support_photo__support.rb CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / net / mikutter / patches

File: [cvs.NetBSD.org] / pkgsrc / net / mikutter / patches / Attic / patch-core_plugin_photo__support_photo__support.rb (download)

Revision 1.7, Fri Feb 15 22:23:53 2019 UTC (16 months, 2 weeks ago) by tsutsui
Branch: MAIN
CVS Tags: pkgsrc-2019Q1-base, pkgsrc-2019Q1
Changes since 1.6: +2 -2 lines

mikutter: fix build (a missed patch in previous).

$NetBSD: patch-core_plugin_photo__support_photo__support.rb,v 1.7 2019/02/15 22:23:53 tsutsui Exp $

- temporary workaround to skip totorijp gems (sorry, @toshi_a)

--- core/plugin/photo_support/photo_support.rb.orig	2018-10-28 04:50:27.000000000 +0000
+++ core/plugin/photo_support/photo_support.rb
@@ -1,7 +1,7 @@
 # coding: utf-8
 require 'nokogiri'
 require 'httpclient'
-require 'totoridipjp'
+#require 'totoridipjp'
 require 'json'
 
 module Plugin::PhotoSupport
@@ -172,9 +172,14 @@ Plugin.create :photo_support do
 
   # totori.dip.jp
   defimageopener('totori.dip.jp', %r#\Ahttp://totori\.dip\.jp/?\Z#) do |display_url|
-    iwashi = Totoridipjp.㦱墥㢣墥㢢墥墬
-    if iwashi.url
-      open(iwashi.url) end
+#    iwashi = Totoridipjp.㦱墥㢣墥㢢墥墬
+#    if iwashi.url
+#      open(iwashi.url) end
+    connection = HTTPClient.new
+    page = connection.get_content(display_url)
+    next nil if page.empty?
+    doc = Nokogiri::HTML(page)
+    open(doc.css('meta[property="og:image"]').first.attribute('content'))
   end
 
   # 600eur.gochiusa.net