Skip to content

Instantly share code, notes, and snippets.

@jskopek
Created April 25, 2012 01:51
Show Gist options
  • Save jskopek/2485434 to your computer and use it in GitHub Desktop.
Save jskopek/2485434 to your computer and use it in GitHub Desktop.
import oembed
content = "http://www.youtube.com/watch?v=c9YrfHVB4ic"
consumer = oembed.OEmbedConsumer()
youtube = oembed.OEmbedEndpoint('http://www.youtube.com/oembed', ['http://*youtube.com*'])
vimeo = oembed.OEmbedEndpoint('http://vimeo.com/api/oembed.json', ['http://*vimeo.com*'])
consumer.addEndpoint(youtube)
consumer.addEndpoint(vimeo)
response = consumer.embed(content)
print response['html']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment