0.01
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Configurable Lita handler for responding to certain phrases with images
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 3.0.0.beta2

Runtime

>= 0
 Project Readme

lita-static-meme

lita-static-meme is a handler for Lita that allows you to respond to arbitrary regular expressions with given images.

There are existing gems that dynamically generate memes from given snippets of text, but sometimes you just want Lita to respond to a particular phrase with a static image. One approach would be to write a separate handler for each phrase / image pair, but wouldn't you rather just specify a mapping between regular expressions and URLs? (I would!)

Installation

As per usual, add that puppy to your Gemfile:

gem 'lita-static-meme'

Configuration

Lita.configure do |config|
  ...
  config.handlers.static_meme.mapping = {
    /ship it/i => "https://skitch-img.s3.amazonaws.com/20111026-r2wsngtu4jftwxmsytdke6arwd.png", # specify a single response image...
    /deal with it/i => ["http://i.imgur.com/ykDuU.gif", "http://i.imgur.com/3PWHn.gif"] # ...or a set to randomly choose from
  }
  ...
end

Usage

Given the configuration above:

jordan_killpack: blah blah blah she should just deal with it already

Lita: DEAL WITH IT