OEmbed anything.
Project description
feincms-oembed converts standard URLs from more than 200 content providers into embedded videos, images and rich article previews by letting Embedly or another oEmbed provider to the hard work.
It’s stunningly simple to use:
Add 'feincms_oembed' to INSTALLED_APPS.
Create the content type:
from feincms.module.page.models import Page from feincms_oembed.contents import OembedContent TYPE_CHOICES=[ ('default', _('Default presentation'), {'maxwidth': 500, 'maxheight': 300, 'wmode': 'opaque'}), ('transparent, _('Transparent'), {'maxwidth': 500, 'maxheight': 300, 'wmode': 'transparent'}), ]) Page.create_content_type(OembedContent, TYPE_CHOICES=TYPE_CHOICES)
If you want to customize the Embedly request or use another OEmbed provider, set settings.OEMBED_PROVIDER to a function receiving the URL and a dict with additional arguments and returning a suitable URL which returns OEmbed JSON on access. OEMBED_PROVIDER must either be a dotted python path or a callable:
from feincms_oembed.providers import embedly_oembed_provider def my_provider(url, kwargs): kwargs['wmode'] = 'opaque' return embedly_oembed_provider(url, kwargs) OEMBED_PROVIDER = 'path.to.module.my_provider' # OEMBED_PROVIDER = my_provider # The function can be used too, not only the # dotted python path.
Using the FeedContent
If you want to use the FeedContent, make sure you have feedparser in your Python Path: https://code.google.com/p/feedparser/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file feincms-oembed-1.0.0.tar.gz
.
File metadata
- Download URL: feincms-oembed-1.0.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a09e4a6890d22fa0a56297395b8d7cc0df474ce5baea461cd0cf802a3b1d6dff |
|
MD5 | 4a0047f76d3d9dec6257de752f5f776e |
|
BLAKE2b-256 | eca323c214ec45317c01c3d04011cb433acade755737fe479d7755e6a67f83dd |