Implements an OEmbed consumer to use with OEmbed providers
Version: 0.1.2python-oembed is a Python library that provides a pure python OEmbed consumer to get resources from OEmbed providers.
License: MIT/X Consortium License
Operating System: Linux
Based on reference from http://oembed.com/
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.
OEmbed format authors:
- Cal Henderson (cal at iamcal.com)
- Mike Malone (mike at pownce.com)
- Leah Culver (leah at pownce.com)
- Richard Crowley (r at rcrowley.org)
To create an instance of the oEmbed consumer:
>>> import oembed
>>> consumer = oembed.OEmbedConsumer()
To add a provider endpoint to this consumer:
- The first parameter is the URL of the endpoint published by the provider.
- The second parameter is the URL schema to use with this endpoint.
>>> endpoint = oembed.OEmbedEndpoint('http://www.flickr.com/services/oembed', ['http://*.flickr.com/*'])
To get the provider response for a URL:
response = consumer.embed('http://www.flickr.com/photos/wizardbt/2584979382/')
To print the response results (each field can be read as a python dict, None if empty):
To read the full documentation:
$ pydoc oembed