Coder Social home page Coder Social logo

icodein / memegen-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jacebrowning/memegen

0.0 2.0 0.0 109.28 MB

The free and open source API to generate memes.

Home Page: https://memegen.link

License: MIT License

Makefile 2.97% Python 96.57% Shell 0.47%

memegen-1's Introduction

An API to programmatically generate memes based solely on requested URLs.

Build Status Coverage Status Swagger Validator License GitHub Sponsors

Buy me a coffee to help keep this site running!


Images

The API is stateless so URLs contain all the information necessary to generate meme images. For example, https://api.memegen.link/images/buzz/memes/memes_everywhere.png produces:

Example Image

Available Formats

Clients can request .jpg instead of .png for smaller files:

Format Example
PNG /images/ds/small_file/high_quality.png
JPEG /images/ds/high_quality/small_file.jpg

Custom Dimensions

Images can be scaled to a specific width via ?width=<int> or a specific height via ?height=<int>. If both parameters are provided (?width=<int>&height=<int>), the image will be padded to the exact dimensions.

For example, https://api.memegen.link/images/both/width_or_height/why_not_both~q.png?height=350&width=600 produces:

Custom Size

Special Characters

In URLs, spaces can be inserted using underscores or dashes:

  • underscore (_) → space ( )
  • dash (-) → space ( )
  • 2 underscores (__) → underscore (_)
  • 2 dashes (--) → dash (-)
  • tilde + N (~n) → newline character

Reserved URL characters can be included using escape patterns:

  • tilde + Q (~q) → question mark (?)
  • tilde + A (~a) → ampersand (&)
  • tilde + P (~p) → percentage (%)
  • tilde + H (~h) → hashtag/pound (#)
  • tilde + S (~s) → slash (/)
  • tilde + B (~b) → backslash (\)
  • 2 single quotes ('') → double quote (")

For example, https://api.memegen.link/images/doge/~hspecial_characters~q/underscore__-dash--.png produces:

Escaped Characters

All of the POST endpoints will return image URLs with speical characters replaced with these alternatives.

Templates

The list of predefined meme templates is available here: https://api.memegen.link/templates/

Alternate Styles

Some memes come in multiple forms, which can be selected via ?style=<style>.

For example, the https://api.memegen.link/templates/ds/ template provides these styles:

/images/ds.png /images/ds.png?style=maga
Default Style Alternate Style

Custom Backgrounds

You can also use your own image URL as the background. For example, https://api.memegen.link/images/custom/_/my_background.png?background=http://www.gstatic.com/webp/gallery/1.png produces:

Custom Background

Sample Code

Here are some popular apps and integrations to check out:

Platforms Language Website
Slack Python https://github.com/nicolewhite/slack-meme
Slack Go https://github.com/CptSpaceToaster/slackbot
Slack -- http://www.memetizer.com
Hain JavaScript https://github.com/Metrakit/hain-plugin-meme
Web Clojure https://github.com/jasich/mighty-fine-memes
Web & Slack -- https://memecomplete.com
Discord JavaScript https://github.com/parshsee/discordbot

Additional clients can be found by searching for code examples on GitHub.

Ready to build your own? Check out the clients page.

memegen-1's People

Contributors

jacebrowning avatar kyluca avatar withshubh avatar hashtagselfie avatar danlindeman avatar dependabot[bot] avatar

Watchers

James Cloos 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.