GithubHelp home page GithubHelp logo

debmeo's Introduction

debmeo: oEmbed for Python 3 travis

This is yet another Python oEmbed library - but for Python 3 asyncio.

There is no caching of oembed URLs for services, only discovery is supported. This means no list of URLs needs to be kept up to date.

Installation

pip install debmeo

Usage

Usage is pretty dang simple.

import asyncio
from debmeo.discover import get_embed

loop = asyncio.get_event_loop()
url = "https://twitter.com/bmuller/status/436965622082068481"
result = loop.run_until_complete(get_embed(url))
print(result)

which will poop out:

{
    'provider_url': 'https://twitter.com',
    'url': 'https://twitter.com/bmuller/statuses/436965622082068481',
    'html': '<blockquote class="twitter-tweet"><p>&quot;So You Think You Found a Technical Co-founder&quot; - a list of questions to ask yourself and them - <a href="http://t.co/ALixRKwk8e">http://t.co/ALixRKwk8e</a></p>&mdash; bmuller (@bmuller) <a href="https://twitter.com/bmuller/statuses/436965622082068481">February 21, 2014</a></blockquote>\n<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>',
    'author_name': 'bmuller',
    'height': None,
    'width': 550,
    'version': '1.0',
    'author_url': 'https://twitter.com/bmuller',
    'provider_name': 'Twitter',
    'cache_age': '3153600000',
    'type': 'rich'
}

If the oEmbed data can be found, it will be returned as a dictionary. If it can't be found, None will be given to the callback.

Easy peasy, and it's all asynchronous.

debmeo's People

Contributors

bmuller avatar

Watchers

Ray Lugo, Jr. avatar  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.