Code Monkey home page Code Monkey logo

embedx's Introduction

License PyPI version Code Issues

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()
"<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,
  • Github gist,
  • Flickr image

Examples of URLs

Valid

Invalid:

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()
"<div class='embed-container'><iframe src='http://www.youtube.com/embed/_lOT2p_FCvA' 'frameborder='0'allowfullscreen></iframe></div>"

>>> oc = OnlineContent('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 cases for automated testing

  • Provision Travis-CI for automatic building & testing

  • Add support for conda-based installation

  • Add more rich-content sites

    • Github gists
    • Facebook status
    • Facebook notes
    • Scribd docs
    • Imgur images

Contributors

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.

embedx's People

Contributors

kmonsoor avatar quantifiedcode-bot avatar myjnjb avatar philip-bl avatar

Watchers

James Cloos avatar Audric Schiltknecht avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.