GithubHelp home page GithubHelp logo

mitchellaw / compuglobal Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 2.0 122 KB

Python wrapper for the CGHMC API (Frinkiac, Morbotron, Master Of All Science and more!)

License: MIT License

Python 100.00%
frinkiac morbotron master-of-all-science frinkiac-api morbotron-api master-of-all-science-api api-wrapper python python-3 compuglobal

compuglobal's Introduction

Internet King Popup Banner by BLUEamnesiac

CompuGlobal

Python wrapper for all endpoints of the following undocumented APIs:

Frinkiac, Morbotron, Master Of All Science, Capital Beat Us and Good God Lemon

Note: I'll be keeping the wrapper up to date as more APIs are released.

CompuGlobal allows for both random and searchable screencaps, images and gifs embedded with default or custom captions for the following shows:

The Simpsons, Futurama, Rick and Morty, West Wing and 30 Rock.

Make sure to acquaint yourself with the API using the documentation.

Installation

To install the library, you can just run the following command:

python3 -m pip install -U compuglobal

Basic Usage

import compuglobal

simpsons = compuglobal.Frinkiac()

# Random
screencap = simpsons.get_random_screencap()

# Search
screencap = simpsons.search_for_screencap('nothing at all')

# Images/Gifs
image = screencap.get_meme_url()
gif = screencap.get_gif_url()

For documented examples, check here.

Async Usage

import asyncio

import compuglobal


async def main():
    simpsons = compuglobal.aio.Frinkiac()

    # Random
    screencap = await simpsons.get_random_screencap()

    # Search
    screencap = await simpsons.search_for_screencap('nothing at all')

    # Images/Gifs
    image = screencap.get_meme_url()
    gif = await screencap.get_gif_url()

if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

For documented examples, check here.

What's New

0.2.7 - Breaking changes

These changes are intended to provide more flexibility in the formatting of captions:

  • Added format_caption() method to CompuGlobalAPI objects. This replaces the formatting logic previously within the encode_caption() method. The encode_caption() method now only takes a caption parameter.
  • Captions will no longer be formatted and shortened before generation of memes, gifs, and mp4 urls if a caption is given. Behaviour remains the same if no caption is given or if format_caption() is used on the caption beforehand.

0.2.1 - Breaking Changes

  • Added Frame object: search(), get_frames() and get_nearby_frames() now all return a list of Frame objects instead of the json response.

Preview

https://frinkiac.com/gif/S11E10/315560/322560.gif?b64lines=IFdFTEwsIElUIEFMTE9XUyBGT1IKIE1BWElNVU0gTU9CSUxJVFkuCiBGRUVMUyBMSUtFIEknTSBXRUFSSU5HCiBOT1RISU5HIEFUIEFMTC4=

Credits

Creators and contributors of Frinkiac, Morbotron, Master of All Science, Good God Lemon and Capital Beat Us:

BLUEamnesiac for the Internet King Popup Banner

Named CompuGlobal as shorthand for CompuGlobalHyperMegaCap, as the family of websites are named.

compuglobal's People

Contributors

mitchellaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

compuglobal's Issues

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.