プロジェクト

全般

プロフィール

環境対応 #775 » 0001-INSTAGRAM.patch

Satoshi Okuno, 2015-09-22 07:12

差分を表示:

core/plugin/photo_support/photo_support.rb
3 3
require 'httpclient'
4 4

  
5 5
module Plugin::PhotoSupport
6
  INSTAGRAM_PATTERN = %r{^http://(?:instagr\.am|instagram\.com)/p/([a-zA-Z0-9_\-]+)}
6
  INSTAGRAM_PATTERN = %r{^https?://(?:instagr\.am|instagram\.com)/p/([a-zA-Z0-9_\-]+)}
7 7
end
8 8

  
9 9
Plugin.create :photo_support do
......
145 145
  defimageopener('instagram', Plugin::PhotoSupport::INSTAGRAM_PATTERN) do |display_url|
146 146
    m = display_url.match(Plugin::PhotoSupport::INSTAGRAM_PATTERN)
147 147
    shortcode = m[1]
148
    open("http://instagram.com/p/#{shortcode}/media/?size=l")
148
    open("https://instagram.com/p/#{shortcode}/media/?size=l")
149 149
  end
150 150

  
151 151
  # d250g2
    (1-1/1)