Sha256: 7dad180c763b20d8a4874f21331e7b6d24857954dae381a318f20e38fcec01c4

Contents?: true

Size: 307 Bytes

Versions: 3

Compression:

Stored size: 307 Bytes

Contents

require 'uri'
require 'net/http'

AutoHtml.add_filter(:instagram) do |text|
  text << '/' unless text.end_with?('/')
  regex = %r{https?:\/\/(www.)?instagr(am\.com|\.am)/p/.+}
  text.gsub(regex) do
    %{<iframe src="#{text}embed" height="714" width="616" frameborder="0" scrolling="no"></iframe>}
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
auto_html-1.6.4 lib/auto_html/filters/instagram.rb
auto_html-1.6.3 lib/auto_html/filters/instagram.rb
auto_html-1.6.2 lib/auto_html/filters/instagram.rb