提案 #1294 » 0001-nicoseiga-support.patch
core/plugin/photo_support/photo_support.rb | ||
---|---|---|
227 | 227 |
img = Plugin::PhotoSupport.d250g2(display_url) |
228 | 228 |
open(img) if img |
229 | 229 |
end |
230 | ||
231 |
# ニコニコ静画 |
|
232 |
defimageopener('NicoSeiga', %r<\Ahttps?://seiga\.nicovideo\.jp/seiga/im\d+>) do |display_url| |
|
233 |
img = Plugin::PhotoSupport.インスタ映え(display_url) |
|
234 |
open(img) if img |
|
235 |
end |
|
236 | ||
237 |
# ニコニコ静画 (nico.ms経由) |
|
238 |
defimageopener('NicoSeiga via nico.ms', %r<\Ahttps?://nico\.ms/im\d+>) do |display_url| |
|
239 |
connection = HTTPClient.new |
|
240 |
location = connection.get(display_url).header['Location'].first |
|
241 |
next nil if location.nil? |
|
242 |
img = Plugin::PhotoSupport.インスタ映え(location) |
|
243 |
open(img) if img |
|
244 |
end |
|
230 | 245 |
end |