Retrieves useful information about a link.
Project description
Library to get the meta informations of a web page and embed its content.
Typically what happens when you post a video on Facebook or Twitter.
Usage
Command line:
$ python embed.py http://www.youtube.com/watch?v=-r3VuOyr9lk
{ 'default': { 'desc': 'SERJ TANKIAN PERFORMING HONKING ANTELOPE Ft APO(AUCKLAND PHILHARMONIA ORCHESTRA) HD QUALITY "ELECT THE DEAD SYMPHONY" DVD RIP{2010}',
'title': u'Serj Tankian - Honking Antelope {Elect The Dead Symphony} (HD/DVD Quality) - YouTube'},
'global': { 'desc': 'SERJ TANKIAN PERFORMING HONKING ANTELOPE Ft APO(AUCKLAND PHILHARMONIA ORCHESTRA) HD QUALITY "ELECT THE DEAD SYMPHONY" DVD RIP{2010}',
'picture_height': 360,
'picture_url': 'http://i1.ytimg.com/vi/-r3VuOyr9lk/maxresdefault.jpg',
'picture_width': 480,
'title': 'Serj Tankian - Honking Antelope {Elect The Dead Symphony} (HD/DVD Quality)',
'video_height': '720',
'video_url': 'https://www.youtube.com/embed/-r3VuOyr9lk',
'video_width': '960'},
'oembed': { u'author_name': u'ObeyYourSysteM',
u'author_url': u'http://www.youtube.com/user/ObeyYourSysteM',
u'height': 344,
u'html': u'<iframe width="459" height="344" src="http://www.youtube.com/embed/-r3VuOyr9lk?feature=oembed" frameborder="0" allowfullscreen></iframe>',
u'provider_name': u'YouTube',
u'provider_url': u'http://www.youtube.com/',
u'thumbnail_height': 360,
u'thumbnail_url': u'http://i1.ytimg.com/vi/-r3VuOyr9lk/hqdefault.jpg',
u'thumbnail_width': 480,
u'title': u'Serj Tankian - Honking Antelope {Elect The Dead Symphony} (HD/DVD Quality)',
u'type': u'video',
u'version': u'1.0',
'video_url': 'http://www.youtube.com/embed/-r3VuOyr9lk?feature=oembed',
u'width': 459},
'opengraph': { 'desc': 'SERJ TANKIAN PERFORMING HONKING ANTELOPE Ft APO(AUCKLAND PHILHARMONIA ORCHESTRA) HD QUALITY "ELECT THE DEAD SYMPHONY" DVD RIP{2010}',
'picture_url': 'http://i1.ytimg.com/vi/-r3VuOyr9lk/maxresdefault.jpg',
'title': 'Serj Tankian - Honking Antelope {Elect The Dead Symphony} (HD/DVD Quality)',
'video_height': '720',
'video_url': 'http://www.youtube.com/v/-r3VuOyr9lk?version=3&autohide=1',
'video_width': '960'},
'twitter': { 'desc': 'SERJ TANKIAN PERFORMING HONKING ANTELOPE Ft APO(AUCKLAND PHILHARMONIA ORCHESTRA) HD QUALITY "ELECT THE DEAD SYMPHONY" DVD RIP{2010}',
'picture_url': 'http://i1.ytimg.com/vi/-r3VuOyr9lk/maxresdefault.jpg',
'title': 'Serj Tankian - Honking Antelope {Elect The Dead Symphony} (HD/DVD Quality)',
'video_height': '720',
'video_url': 'https://www.youtube.com/embed/-r3VuOyr9lk',
'video_width': '960'}}
You should use the ‘global’ values which are a copy of what’s available in the different backends unless you want the information provided for a specific format/platform.
To use it in your code, you can do:
from embeder import embed
data = embed.get('http://www.youtube.com/watch?v=-r3VuOyr9lk')
Backends
the default backend retrieves the title and the description metatag of the page
the oembed backend retrieves some oembed informations: http://oembed.com/
the opengraph backend retrieves some opengraph metatags: http://ogp.me/
the twitter backend retrieves some of the twitter metatags: https://dev.twitter.com/docs/cards/markup-reference
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 Embeder-0.1.2.tar.gz.
File metadata
- Download URL: Embeder-0.1.2.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e43755a1533891670e93d5f419c53b3bfc879f52d15c24d7d9076e3b6ce4547
|
|
| MD5 |
ae8770145b4f7f337f176b3bf4da2472
|
|
| BLAKE2b-256 |
5d2b52b086c1ad3d17ff7e776aed366670f8b1a61df16702a5d15130e7590a45
|