lita-memegen 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -2
- data/lib/lita/handlers/memegen.rb +26 -22
- data/lita-memegen.gemspec +1 -1
- data/spec/lita/handlers/memegen_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa0919ce1d56a987b4fc48d80ad5c3efc283ae77
|
4
|
+
data.tar.gz: 58558173486a6776e5943c12a24637de27fa85b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de40f01cc101bdccb68dc7605bc515c9100210840bec778223e73655d3c8e2770d729524377239aec4a4cda9a9dc6e27f2373d88c2a39a0462d4c69415090c79
|
7
|
+
data.tar.gz: 34caed9e92332780d9c653f91d9e5fca17376fa3454fef4100f06aed83462529e7cf598bd9bbe5c5f9f73b839a9af6e10210001d2e751780409bd4795e84f87c
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
[![Code Climate](https://codeclimate.com/github/webdestroya/lita-memegen.png)](https://codeclimate.com/github/webdestroya/lita-memegen)
|
5
5
|
[![Coverage Status](https://coveralls.io/repos/webdestroya/lita-memegen/badge.png)](https://coveralls.io/r/webdestroya/lita-memegen)
|
6
6
|
|
7
|
-
**lita-memegen** is a handler for [Lita](https://github.com/jimmycuadra/lita) that generates meme images using memegenerator.net.
|
7
|
+
**lita-memegen** is a handler for [Lita](https://github.com/jimmycuadra/lita) that generates meme images using memegenerator.net. This is based on the hubot memegenerator script.
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
@@ -20,6 +20,10 @@ You will need to register an account on memegenerator.net and provide the userna
|
|
20
20
|
|
21
21
|
```
|
22
22
|
Lita.configure do |config|
|
23
|
+
|
24
|
+
# This requires that all memes be sent as commands. If this is false, the bot will listen in the channel
|
25
|
+
config.handlers.memegen.command_only = true
|
26
|
+
|
23
27
|
config.handlers.memegen.username = 'username'
|
24
28
|
config.handlers.memegen.password = 'password'
|
25
29
|
end
|
@@ -27,7 +31,27 @@ end
|
|
27
31
|
|
28
32
|
## Usage
|
29
33
|
|
30
|
-
|
34
|
+
* `Y U NO <text>` - Generates the Y U NO GUY with the bottom caption of <text>
|
35
|
+
* `I don't always <something> but when i do <text>` - Generates The Most Interesting man in * `<text> ORLY?` - Generates the ORLY? owl with the top caption of <text>
|
36
|
+
* `<text> (SUCCESS|NAILED IT)` - Generates success kid with the top caption of <text>
|
37
|
+
* `<text> ALL the <things>` - Generates ALL THE THINGS
|
38
|
+
* `<text> TOO DAMN <high>` - Generates THE RENT IS TOO DAMN HIGH guy
|
39
|
+
* `good news everyone! <news>` - Generates Professor Farnsworth
|
40
|
+
* `khanify <text>` - TEEEEEEEEEEEEEEEEEXT!
|
41
|
+
* `Not sure if <text> or <text>` - Generates Futurama Fry
|
42
|
+
* `Yo dawg <text> so <text>` - Generates Yo Dawg
|
43
|
+
* `ALL YOUR <text> ARE BELONG TO US` - Generates Zero Wing with the caption of <text>
|
44
|
+
* `if <text>, <word that can start a question> <text>?` - Generates Philosoraptor
|
45
|
+
* `<text> FUCK YOU` - Angry Linus
|
46
|
+
* `(Oh|You) <text> (Please|Tell) <text>` - Willy Wonka
|
47
|
+
* `<text> you're gonna have a bad time` - Bad Time Ski Instructor
|
48
|
+
* `one does not simply <text>` - Lord of the Rings Boromir
|
49
|
+
* `it looks like (you|you're) <text>` - Generates Clippy
|
50
|
+
* `AM I THE ONLY ONE AROUND HERE <text>` - The Big Lebowski
|
51
|
+
* `<text> NOT IMPRESSED` - Generates McKayla Maroney
|
52
|
+
* `PREPARE YOURSELF <text>` - Generates GoT
|
53
|
+
* `WHAT IF I TOLD YOU <text>` - Generates Morpheus
|
54
|
+
* `<text> BETTER DRINK MY OWN PISS` - Generates Bear Grylls
|
31
55
|
|
32
56
|
## License
|
33
57
|
|
@@ -5,30 +5,31 @@ module Lita
|
|
5
5
|
class Memegen < Handler
|
6
6
|
|
7
7
|
def self.default_config(config)
|
8
|
+
config.command_only = true
|
8
9
|
config.username = nil
|
9
10
|
config.password = nil
|
10
11
|
end
|
11
12
|
|
12
|
-
route %r{(
|
13
|
-
route %r{(
|
14
|
-
route %r{(
|
15
|
-
route %r{(
|
16
|
-
route %r{(
|
17
|
-
route %r{(
|
18
|
-
route %r{(
|
19
|
-
route %r{(
|
20
|
-
route %r{(
|
21
|
-
route %r{(
|
22
|
-
route %r{(
|
23
|
-
route %r{(
|
24
|
-
route %r{(
|
25
|
-
route %r{(
|
26
|
-
route %r{(
|
27
|
-
route %r{(
|
28
|
-
route %r{(
|
29
|
-
route %r{(
|
30
|
-
route %r{(
|
31
|
-
route %r{(
|
13
|
+
route %r{(Y U NO) (.+)}i, :meme_y_u_no
|
14
|
+
route %r{(I DON'?T ALWAYS .*) (BUT WHEN I DO,? .*)}i, :meme_i_dont_always
|
15
|
+
route %r{(.*)(O\s?RLY\??.*)}i, :meme_orly
|
16
|
+
route %r{(.*)(SUCCESS|NAILED IT.*)}i, :meme_success
|
17
|
+
route %r{(.*) (ALL the .*)}i, :meme_all_the
|
18
|
+
route %r{(.*) (\w+\sTOO DAMN .*)}i, :meme_too_damn
|
19
|
+
route %r{(GOOD NEWS EVERYONE[,.!]?) (.*)}i, :meme_good_news
|
20
|
+
route %r{(NOT SURE IF .*) (OR .*)}i, :meme_not_sure_if
|
21
|
+
route %r{(YO DAWG .*) (SO .*)}i, :meme_yo_dawg
|
22
|
+
route %r{(ALL YOUR .*) (ARE BELONG TO US)}i, :meme_are_belong
|
23
|
+
route %r{(.*) (FUCK YOU)}i, :meme_fuck_you
|
24
|
+
route %r{(.*) (You'?re gonna have a bad time)}i, :meme_bad_time
|
25
|
+
route %r{(one does not simply) (.*)}i, :meme_simply
|
26
|
+
route %r{(grumpy cat) (.*),(.*)}i, :meme_grumpy_cat
|
27
|
+
route %r{(it looks like you're|it looks like you) (.*)}i, :meme_looks_like
|
28
|
+
route %r{(AM I THE ONLY ONE AROUND HERE) (.*)}i, :meme_am_i_only
|
29
|
+
route %r{(.*)(NOT IMPRESSED*)}i, :meme_not_impressed
|
30
|
+
route %r{(PREPARE YOURSELF) (.*)}i, :meme_prepare_yourself
|
31
|
+
route %r{(WHAT IF I TOLD YOU) (.*)}i, :meme_what_if_i
|
32
|
+
route %r{(.*) (BETTER DRINK MY OWN PISS)}i, :meme_better_drink
|
32
33
|
|
33
34
|
|
34
35
|
def meme_y_u_no(response)
|
@@ -115,8 +116,11 @@ module Lita
|
|
115
116
|
private
|
116
117
|
|
117
118
|
def generate_meme(response, generator_id, image_id)
|
118
|
-
|
119
|
-
|
119
|
+
|
120
|
+
return if Lita.config.handlers.memegen.command_only && !response.message.command?
|
121
|
+
|
122
|
+
line1 = response.matches[0][0]
|
123
|
+
line2 = response.matches[0][1]
|
120
124
|
return if Lita.config.handlers.memegen.username.nil? || Lita.config.handlers.memegen.password.nil?
|
121
125
|
|
122
126
|
http_resp = http.get(
|
data/lita-memegen.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe Lita::Handlers::Memegen, lita_handler: true do
|
4
|
-
it { routes_command("Y U NO BLAH").to(:
|
4
|
+
it { routes_command("Y U NO BLAH").to(:meme_y_u_no) }
|
5
5
|
|
6
6
|
it "sets the username and password to nil by default" do
|
7
7
|
expect(Lita.config.handlers.memegen.username).to be_nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-memegen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mitch Dempsey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|