oEmbed client on Ruby
oEmbed is a format for allowing an embedded representation of a URL on third party sites. The simple API allows a website to display embedded content (such as photos or videos) when a user posts a link to that resource, without having to parse the resource directly.
I've created oembed gem. This library helps to you build a client for any oEmbed provider.
require 'oembed'
class SpeakerDeck
include Oembed::Client
# oEmbed endpoint URI
def endpoint_uri
'http://speakerdeck.com/oembed.json'
end
end
# Create client and fetch data
client = SpeakerDeck.new
client.fetch('https://speakerdeck.com/u/soulim/p/rails')
The method #fetch
will return a hash with oEmded data.
Written by Alex Sulim
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#