バグ #812 » 0001-gyazo.patch
core/plugin/photo_support/photo_support.rb | ||
---|---|---|
57 | 57 |
end |
58 | 58 | |
59 | 59 |
# gyazo |
60 |
defimageopener('gyazo', %r<^http://gyazo.com/[a-zA-Z0-9]+>) do |display_url|
|
|
60 |
defimageopener('gyazo', %r<\Ahttps?://gyazo.com/[a-zA-Z0-9]+>) do |display_url|
|
|
61 | 61 |
connection = HTTPClient.new |
62 | 62 |
page = connection.get_content(display_url) |
63 | 63 |
next nil if page.empty? |
64 | 64 |
doc = Nokogiri::HTML(page) |
65 |
result = doc.css('#gyazo_img').first
|
|
65 |
result = doc.css('.image').first
|
|
66 | 66 |
open(result.attribute('src')) |
67 | 67 |
end |
68 | 68 |