Skip to content

Instantly share code, notes, and snippets.

@picandocodigo
Created February 14, 2013 17:59
Show Gist options
  • Save picandocodigo/4954739 to your computer and use it in GitHub Desktop.
Save picandocodigo/4954739 to your computer and use it in GitHub Desktop.
Get speakerdeck oEmbed url
def slide(slide)
if slide.match('speakerdeck')
require 'net/http'
url = URI.parse("https://speakerdeck.com/oembed.json?url=#{slide}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
response = http.request(Net::HTTP::Get.new(url.request_uri))
response.body
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment