Thanks to visit codestin.com
Credit goes to github.com

Skip to content

iocanel/imgflip.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Imgflip API client for Emacs Lisp

./meme.jpg

Features

  • Elisp client for imgflip
  • Snippets for org-mode that allow users to easily embed memes in their org files.

Installation

This plugin is not currently available on any repository, so the simplest way to install is via straight.el.

(use-package imgflip.el :straight (imgflip.el :host github :repo "iocanel/imgflip.el")
  :custom (imgflip-download-dir "~/.imgflip" "Where my images will be downloaded"`)
  :config
  (setq imgflip-username "< your username >"
        imgflip-passowrd "< your password >"))

Using

Getting the top templates

Using the function below you will get an alist with the top templates description and id’s

(imgflip-get-top-templates)

Create and downalod an image

With a template id

(imgflip-download-caption-image "<template id>" "<Top text (text0)>" "<Bottom text (text1)>")

Without a template id

To make it easier, the function can work without a template id, by passing a `template query string`. This will only work for templates in the `Top 100` list. Matching of the quesry string is done based on the most common words between the string and the template description.

(imgflip-download-caption-image "Morpheus" "What if I told you..." "that it works even without a template id?")

Snippet

An `imgflip` snippet is also provided for `org-mode` that gets as field values:

  • The template id or query string
  • The top text (text0)
  • The bottom text (text1)

And expands to an org link to the downloaded image. Once the expansion is complete, the linked image will also be displayed.

For example:

`imgflip` with the following fields:

  • Morpheus
  • What if I told you?
  • that once your press tab the meme will be added to your buffer?

    will expand to:

#+CAPTION: Morpheus - What if i told you / that once you press tab the meme will be added to your buffer?
[[~/Downloads/imgflip/Morpheus-What-if-i-told-you-that-once-you-press-tab-the-meme-will-be-added-to-your-buffer?.jpg]]

About

Imgflip API client for Emacs Lisp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages