Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Generate embeddable HTML or JavaScript code for a online content from its URL in single step

Project Description
|License|

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&amp;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/
Release History

Release History

History Node

0.0.7

History Node

0.0.6

History Node

0.0.5

History Node

0.0.4

This version
History Node

0.0.3

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
embedX-0.0.3-py2.py3-none-any.whl (2.2 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Jan 12, 2016
embedX-0.0.3.tar.gz (2.7 kB) Copy SHA256 Checksum SHA256 Source Jan 12, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting