Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dpritchett/lita-imgflip-memes
Make image macros for your Lita chatbot 🤖
https://github.com/dpritchett/lita-imgflip-memes
chatbots lita memes rubygems
Last synced: 17 days ago
JSON representation
Make image macros for your Lita chatbot 🤖
- Host: GitHub
- URL: https://github.com/dpritchett/lita-imgflip-memes
- Owner: dpritchett
- Created: 2017-08-01T12:39:00.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-04T17:12:21.000Z (over 6 years ago)
- Last Synced: 2024-08-11T00:03:37.443Z (4 months ago)
- Topics: chatbots, lita, memes, rubygems
- Language: Ruby
- Homepage: https://rubygems.org/gems/lita-imgflip-memes
- Size: 36.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lita-imgflip-memes
[![Gem](https://img.shields.io/gem/dt/lita-imgflip-memes.svg)](https://rubygems.org/gems/lita-imgflip-memes)
[![Build Status](https://travis-ci.org/dpritchett/lita-imgflip-memes.svg?branch=master)](https://travis-ci.org/dpritchett/lita-imgflip-memes)
[![Coverage Status](https://coveralls.io/repos/dpritchett/lita-imgflip-memes/badge.svg)](https://coveralls.io/r/dpritchett/lita-imgflip-memes)Add imgflip meme generation to your Lita bot!
![ancient aliens guy saying 'chat bots'](http://i.imgur.com/FxGSzjVl.jpg)
## Installation
Add lita-imgflip-memes to your Lita instance's Gemfile:
``` ruby
gem "lita-imgflip-memes"
```## Configuration
The 'lita way' to do this is to open up your `lita_config.rb` and set up file-based configuration:```rb
config.handlers.imgflip_memes.api_user = 'myusername'
config.handlers.imgflip_memes.api_password = 'mypassword'
```I have set up this gem to deafult to the following environment variables if the config entries aren't set in `lita_config.rb`:
```rb
ENV['IMGFLIP_API_USER']
ENV['IMGFLIP_API_PASSWORD']
```### Adding new memes to your local Lita bot
On a suggestion from [@joshwlewis](https://github.com/joshwlewis) I've added a way to put new memes in your Lita bot without having to monkey patch this gem. Add them to your `lita_config.rb` with the `add_meme` method:```rb
Lita::Handlers::ImgflipMemes.add_meme(
template_id: 61546,
pattern: /(brace yoursel[^\s]+) (.*)/i,
help: 'brace yourselves, ')
```Note that the `pattern` needs to be a regex and it needs to capture two strings. If you don't have two pairs of parens in your regex you're gonna have a bad time.
## Usage
```
Lita > lita aliens chatbots
http://i.imgflip.com/1tzqwt.jpg
```