embedX
======
Generate embeddable HTML or JavaScript code for a online content from
its URL in a single step.
The content can be: \* Yotube video \* Twitter status \* Vimeo video \*
etc.
Embeddable code-generation be simple like this:
::
>>> from embed_x import OnlineContent
>>> oc = OnlineContent('http://www.youtube.com/embed/_lOT2p_FCvA')
>>> oc.get_embed_code()
"<div class='embedx-yt'><iframe src='http://www.youtube.com/embed/_lOT2p_FCvA' 'frameborder='0' allowfullscreen></iframe></div>"
Currently, supports
~~~~~~~~~~~~~~~~~~~
- Youtube video
- Vimeo video
- Twitter : single status
-
Examples of URLs
~~~~~~~~~~~~~~~~
Valid
^^^^^
- http://youtu.be/\_lOT2p\_FCvA
- www.youtube.com/watch?v=\_lOT2p\_FCvA&feature=feedu
- http://www.youtube.com/embed/\_lOT2p\_FCvA
- http://www.youtube.com/v/\_lOT2p\_FCvA?version=3&hl=en\_US
- https://www.youtube.com/watch?v=rTHlyTphWP0&index=6&list=PLjeDyYvG6-40qawYNR4juzvSOg-ezZ2a6
- youtube.com/watch?v=\_lOT2p\_FCvA
- https://vimeo.com/groups/animation/videos/150618894/
- https://vimeo.com/150519302
- https://twitter.com/codinghorror/status/686254714938200064
-
Invalid:
^^^^^^^^
- youtu.be/watch?v=\_lOT2p\_FCvA [ because Youtube don’t give any url
like this ]
- https://twitter.com/gvanrossum/with\_replies
-
Install
-------
from PyPI
~~~~~~~~~
::
pip install embedX
Directly from source
~~~~~~~~~~~~~~~~~~~~
::
pip install git+https://github.com/kmonsoor/embedX.git
Usage
-----
::
>>> from online_video import OnlineVideo
>>> oc = OnlineVideo('http://www.youtube.com/embed/_lOT2p_FCvA')
>>> oc.get_video_id()
'_lOT2p_FCvA'
>>> oc.get_embed_code()
"<div class='embed-container'><iframe src='http://www.youtube.com/embed/_lOT2p_FCvA' 'frameborder='0'allowfullscreen></iframe></div>"
>>> oc = OnlineVideo('https://vimeo.com/groups/animation/videos/150618894/')
>>> oc.get_embed_code()
"<div class='embed-container'> <iframe src='http://player.vimeo.com/video/150618894' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>"
To-do
-----
- Create test
- Provision Travis-CI for automatic building & testing
- add more content sites
- Github gists
- Facebook status
- Facebook notes
- Scribd docs
- Imgur images
Contributors
------------
- Seed idea : `A StackOverflow answer`_ by `Mikhail Kashkin`_
- Author : `Khaled Monsoor`_
-
Please try to contribute by submitting more content-sites with their
different link formats and embed-codes. You can submit pull-requests or
by creating issue.
.. _A StackOverflow answer: http://stackoverflow.com/a/7936523
.. _Mikhail Kashkin: http://stackoverflow.com/users/85739/mikhail-kashkin
.. _Khaled Monsoor: http://github.com/kmonsoor
.. |License| image:: https://img.shields.io/badge/license-MIT-blue.svg
:target: http://kmonsoor.mit-license.org/
Metadata
Release files for embedX 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| embedX-0.0.3.tar.gz | 2.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| embedX-0.0.3-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 5.0 kB
Release files / embedX-0.0.3.tar.gz
| Download URL | embedX-0.0.3.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f14818bf43f71990e1d21a97107d55ab4d747216e04893ee1aa9ab46602182a0
|
|
BLAKE2b-256 checksum How to use checksums |
986b3d78275adb1939b47a43f5c4ac4d02c22a998ae1ed4326f2f395cd46331a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / embedX-0.0.3-py2.py3-none-any.whl
| Download URL | embedX-0.0.3-py2.py3-none-any.whl |
|---|---|
| Size | 2.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
565d479c599a4a9edfa1473cc36444df4fd47bda31318bee64c561010858cd42
|
|
BLAKE2b-256 checksum How to use checksums |
95aa2a32998b07599e2b75fb67bf27370716ae54c2cd78a99015c2a5e35592ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for embedX 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.