CompuGlobal¶
Python wrapper for 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.
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.
Contents:¶
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.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())
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.
Before:
search_results = simpsons.search('stupid sexy flanders') top_result = search_results[0] screencap = simpsons.get_screencap(top_result['Episode'], top_result['Timestamp'])
After:
search_results = simpsons.search('stupid sexy flanders') top_result = search_results[0] screencap = simpsons.get_screencap(top_result.key, top_result.timestamp)
Preview¶
Credits¶
Creators and contributors of Frinkiac, Morbotron, Master of All Science, Good God Lemon and Capital Beat Us:
Max, Jon Bernhardt, Nick Beatty, Vimp, juz, Iconfactory and Ged Maheux
BLUEamnesiac for the Internet King Popup Banner
Named CompuGlobal as shorthand for CompuGlobalHyperMegaCap, as the family of websites are named.