[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.6, Sun Oct 28 06:47:31 2018 UTC (2 years, 1 month ago) by tsutsui
Branch: MAIN
CVS Tags: pkgsrc-2018Q4-base, pkgsrc-2018Q4
Changes since 1.5: +4 -4 lines

mikutter: update to 3.8.2.

Upstream changes:

mikutter 3.8.2

* support Github image view
 * thanks cob odo
* make display_requirements plugin depend on twitter
 * thanks cob odo
* fix typo
 * thanks cob odo
* explicitly miquire TypedArray used by activity settings
 * thanks cob odo
* resolve deprecated font properties in console plugin
 * thanks Akira Ouchi

Thanks for all visitors to OSC Tokyo!

$NetBSD: patch-core_plugin_photo__support_photo__support.rb,v 1.6 2018/10/28 06:47:31 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'
 
 module Plugin::PhotoSupport
   SUPPORTED_IMAGE_FORMATS = GdkPixbuf::Pixbuf.formats.flat_map{|f| f.extensions }.freeze
@@ -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