Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kmonsoor/embedX
Generate embeddable HTML or JavaScript code for a online content from its URL in single step
https://github.com/kmonsoor/embedX
embeds plugin python
Last synced: 4 months ago
JSON representation
Generate embeddable HTML or JavaScript code for a online content from its URL in single step
- Host: GitHub
- URL: https://github.com/kmonsoor/embedX
- Owner: kmonsoor
- License: mit
- Created: 2016-01-03T21:08:50.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-09-24T02:46:33.000Z (over 6 years ago)
- Last Synced: 2024-08-08T21:11:11.883Z (7 months ago)
- Topics: embeds, plugin, python
- Language: Python
- Homepage: http://kmonsoor.github.io/embedX
- Size: 458 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - kmonsoor/embedX - Generate embeddable HTML or JavaScript code for a online content from its URL in single step (python)
README
[](http://kmonsoor.mit-license.org/)
[](https://badge.fury.io/py/embedX)
[](https://www.quantifiedcode.com/app/project/69f2bf7e3b404e6c90015053e48a1cbf)# embedX
Generate embeddable HTML or JavaScript code for a online content from its URL in a single step.
The content can be anything like
* Youtube or Vimeo video,
* Twitter status,
* Github Gist,
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()
"
### Currently, supports
* Youtube video,
* Vimeo video,
* Twitter: single status,
* Github gist,
* Flickr image### 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
* 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
## Requirements
This library don't have any external dependencies other than standard Python installation.## Usage
>>> from embedx import OnlineContent
>>> oc = OnlineContent('http://www.youtube.com/embed/_lOT2p_FCvA')
>>> oc.extract_id()
'_lOT2p_FCvA'>>> oc.get_embed_code()
"
">>> oc = OnlineContent('https://vimeo.com/groups/animation/videos/150618894/')
"
>>> oc.get_embed_code()
"## To-do
* Create test cases for automated testing
* Provision Travis-CI for automatic building & testing
* Add support for [conda](http://conda.pydata.org/docs/index.html)-based installation
* Add more rich-content sites- [x] Github gists
- [ ] Facebook status
- [ ] Facebook notes
- [ ] Scribd docs
- [ ] Imgur images## Contributors
* Seed idea : [A StackOverflow answer](http://stackoverflow.com/a/7936523) by [Mikhail Kashkin](http://stackoverflow.com/users/85739/mikhail-kashkin)
* Author : [Khaled Monsoor](http://github.com/kmonsoor)
*Please try to contribute by submitting more content-sites with their different link formats and embed-codes. You can submit through pull-requests or by creating issue.