lita-onewheel-giphy 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita-onewheel-giphy.rb +0 -9
- data/lib/lita/handlers/onewheel_giphy.rb +8 -0
- data/lita-onewheel-giphy.gemspec +1 -1
- data/spec/fixtures/translate_good.json +141 -92
- data/spec/lita/handlers/onewheel_giphy_spec.rb +11 -3
- data/spec/spec_helper.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea5fa7cf083a32d35ea2cf48737ff557b375f6c0
|
4
|
+
data.tar.gz: beebc189f97b74a11f465051bf4cce5a7d83da82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbf70766a66276f6a214601f01e9df021602e18b695c2239c6e9248ffd61c6fdc6f3550dcda89f1a8bf9526324caddc44ac180480f5e25f4e1ac68634670ed8a
|
7
|
+
data.tar.gz: 53043edb9424498c10534cabbc4b88fe3111699cef98a0663445ff95740994251e92e6dbd7aeb1143ca1f68f412b57bb64e0072aae7f67fab0a0bb8d200b3c05
|
data/lib/lita-onewheel-giphy.rb
CHANGED
@@ -1,12 +1,3 @@
|
|
1
1
|
require 'lita'
|
2
2
|
|
3
|
-
Lita.load_locales Dir[File.expand_path(
|
4
|
-
File.join('..', '..', 'locales', '*.yml'), __FILE__
|
5
|
-
)]
|
6
|
-
|
7
3
|
require 'lita/handlers/onewheel_giphy'
|
8
|
-
|
9
|
-
Lita::Handlers::OnewheelGiphy.template_root File.expand_path(
|
10
|
-
File.join('..', '..', 'templates'),
|
11
|
-
__FILE__
|
12
|
-
)
|
@@ -12,11 +12,19 @@ module Lita
|
|
12
12
|
:random,
|
13
13
|
command: true,
|
14
14
|
help: {'giphy' => 'Returns a random Giphy image. Powered by Giphy! http://giphy.com'}
|
15
|
+
route /^gif$/i,
|
16
|
+
:random,
|
17
|
+
command: true,
|
18
|
+
help: {'gif' => 'Returns a random Giphy image. Powered by Giphy! http://giphy.com'}
|
15
19
|
route /^giphy\s+(.+)$/i,
|
16
20
|
:translate,
|
17
21
|
# :search,
|
18
22
|
command: true,
|
19
23
|
help: {'giphy [keyword]' => 'Returns a random Giphy image with the specified keyword applied.'}
|
24
|
+
route /^gif\s+(.+)$/i,
|
25
|
+
:translate,
|
26
|
+
command: true,
|
27
|
+
help: {'gif [keyword]' => 'Returns a random Giphy image with the specified keyword applied.'}
|
20
28
|
route /^giphytrending$/i,
|
21
29
|
:trending,
|
22
30
|
command: true,
|
data/lita-onewheel-giphy.gemspec
CHANGED
@@ -1,128 +1,177 @@
|
|
1
1
|
{
|
2
2
|
"data": {
|
3
3
|
"type": "gif",
|
4
|
-
"id": "
|
5
|
-
"
|
6
|
-
"
|
7
|
-
"
|
8
|
-
"
|
4
|
+
"id": "T2NINhwlHgOSk",
|
5
|
+
"slug": "T2NINhwlHgOSk",
|
6
|
+
"url": "https:\/\/giphy.com\/gifs\/T2NINhwlHgOSk",
|
7
|
+
"bitly_gif_url": "http:\/\/gph.is\/1KsF9wP",
|
8
|
+
"bitly_url": "http:\/\/gph.is\/1KsF9wP",
|
9
|
+
"embed_url": "https:\/\/giphy.com\/embed\/T2NINhwlHgOSk",
|
9
10
|
"username": "",
|
10
|
-
"source": "http
|
11
|
+
"source": "http:\/\/www.reddit.com\/r\/reactiongifs\/comments\/3bss8a\/mfw_my_girlfriend_says_its_my_fault_she_peed_on\/",
|
11
12
|
"rating": "g",
|
12
|
-
"caption": "",
|
13
13
|
"content_url": "",
|
14
|
-
"
|
15
|
-
"
|
14
|
+
"source_tld": "www.reddit.com",
|
15
|
+
"source_post_url": "http:\/\/www.reddit.com\/r\/reactiongifs\/comments\/3bss8a\/mfw_my_girlfriend_says_its_my_fault_she_peed_on\/",
|
16
|
+
"is_indexable": 0,
|
17
|
+
"import_datetime": "2015-07-01 21:23:36",
|
18
|
+
"trending_datetime": "2017-02-16 17:57:48",
|
16
19
|
"images": {
|
17
|
-
"fixed_height": {
|
18
|
-
"url": "http://media3.giphy.com/media/wWAIKcFASEFz2/200.gif",
|
19
|
-
"width": "358",
|
20
|
-
"height": "200",
|
21
|
-
"size": "126220",
|
22
|
-
"mp4": "http://media2.giphy.com/media/wWAIKcFASEFz2/200.mp4",
|
23
|
-
"mp4_size": "10967",
|
24
|
-
"webp": "http://media2.giphy.com/media/wWAIKcFASEFz2/200.webp",
|
25
|
-
"webp_size": "186460"
|
26
|
-
},
|
27
20
|
"fixed_height_still": {
|
28
|
-
"url": "
|
29
|
-
"width": "
|
21
|
+
"url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/200_s.gif",
|
22
|
+
"width": "346",
|
30
23
|
"height": "200"
|
31
24
|
},
|
32
|
-
"
|
33
|
-
"url": "
|
34
|
-
"width": "
|
35
|
-
"height": "
|
36
|
-
"size": "352636",
|
37
|
-
"webp": "http://media2.giphy.com/media/wWAIKcFASEFz2/200_d.webp",
|
38
|
-
"webp_size": "159946"
|
25
|
+
"original_still": {
|
26
|
+
"url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/giphy_s.gif",
|
27
|
+
"width": "223",
|
28
|
+
"height": "129"
|
39
29
|
},
|
40
30
|
"fixed_width": {
|
41
|
-
"url": "
|
31
|
+
"url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/200w.gif",
|
42
32
|
"width": "200",
|
43
|
-
"height": "
|
44
|
-
"size": "
|
45
|
-
"mp4": "
|
46
|
-
"mp4_size": "
|
47
|
-
"webp": "
|
48
|
-
"webp_size": "
|
33
|
+
"height": "116",
|
34
|
+
"size": "2003465",
|
35
|
+
"mp4": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/200w.mp4",
|
36
|
+
"mp4_size": "28449",
|
37
|
+
"webp": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/200w.webp",
|
38
|
+
"webp_size": "588938"
|
49
39
|
},
|
50
|
-
"
|
51
|
-
"url": "
|
52
|
-
"width": "
|
53
|
-
"height": "
|
40
|
+
"fixed_height_small_still": {
|
41
|
+
"url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/100_s.gif",
|
42
|
+
"width": "173",
|
43
|
+
"height": "100"
|
54
44
|
},
|
55
|
-
"
|
56
|
-
"url": "
|
57
|
-
"width": "
|
58
|
-
"height": "
|
59
|
-
"size": "
|
60
|
-
"webp": "
|
61
|
-
"webp_size": "
|
45
|
+
"fixed_height_downsampled": {
|
46
|
+
"url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/200_d.gif",
|
47
|
+
"width": "346",
|
48
|
+
"height": "200",
|
49
|
+
"size": "290094",
|
50
|
+
"webp": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/200_d.webp",
|
51
|
+
"webp_size": "72520"
|
52
|
+
},
|
53
|
+
"preview": {
|
54
|
+
"width": "222",
|
55
|
+
"height": "128",
|
56
|
+
"mp4": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/giphy-preview.mp4",
|
57
|
+
"mp4_size": "32305"
|
62
58
|
},
|
63
59
|
"fixed_height_small": {
|
64
|
-
"url": "
|
65
|
-
"width": "
|
60
|
+
"url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/100.gif",
|
61
|
+
"width": "173",
|
66
62
|
"height": "100",
|
67
|
-
"size": "
|
68
|
-
"
|
69
|
-
"
|
63
|
+
"size": "1572931",
|
64
|
+
"mp4": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/100.mp4",
|
65
|
+
"mp4_size": "22526",
|
66
|
+
"webp": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/100.webp",
|
67
|
+
"webp_size": "483610"
|
70
68
|
},
|
71
|
-
"
|
72
|
-
"url": "
|
73
|
-
"width": "
|
74
|
-
"height": "
|
69
|
+
"downsized_still": {
|
70
|
+
"url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/giphy-downsized_s.gif",
|
71
|
+
"width": "223",
|
72
|
+
"height": "129",
|
73
|
+
"size": "20185"
|
75
74
|
},
|
76
|
-
"
|
77
|
-
"url": "
|
78
|
-
"width": "
|
79
|
-
"height": "
|
80
|
-
"size": "
|
81
|
-
|
82
|
-
|
75
|
+
"downsized": {
|
76
|
+
"url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/giphy-downsized.gif",
|
77
|
+
"width": "223",
|
78
|
+
"height": "129",
|
79
|
+
"size": "1478990"
|
80
|
+
},
|
81
|
+
"downsized_large": {
|
82
|
+
"url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/giphy.gif",
|
83
|
+
"width": "223",
|
84
|
+
"height": "129",
|
85
|
+
"size": "1478990"
|
83
86
|
},
|
84
87
|
"fixed_width_small_still": {
|
85
|
-
"url": "
|
88
|
+
"url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/100w_s.gif",
|
86
89
|
"width": "100",
|
87
|
-
"height": "
|
90
|
+
"height": "58"
|
88
91
|
},
|
89
|
-
"
|
90
|
-
"url": "
|
91
|
-
"width": "
|
92
|
-
"height": "
|
93
|
-
"size": "
|
92
|
+
"preview_webp": {
|
93
|
+
"url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/giphy-preview.webp",
|
94
|
+
"width": "185",
|
95
|
+
"height": "107",
|
96
|
+
"size": "49742"
|
94
97
|
},
|
95
|
-
"
|
96
|
-
"url": "
|
97
|
-
"width": "
|
98
|
-
"height": "
|
98
|
+
"fixed_width_still": {
|
99
|
+
"url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/200w_s.gif",
|
100
|
+
"width": "200",
|
101
|
+
"height": "116"
|
99
102
|
},
|
100
|
-
"
|
101
|
-
"url": "
|
102
|
-
"width": "
|
103
|
-
"height": "
|
104
|
-
"size": "
|
103
|
+
"fixed_width_small": {
|
104
|
+
"url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/100w.gif",
|
105
|
+
"width": "100",
|
106
|
+
"height": "58",
|
107
|
+
"size": "649699",
|
108
|
+
"mp4": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/100w.mp4",
|
109
|
+
"mp4_size": "12834",
|
110
|
+
"webp": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/100w.webp",
|
111
|
+
"webp_size": "222072"
|
112
|
+
},
|
113
|
+
"downsized_small": {
|
114
|
+
"width": "222",
|
115
|
+
"height": "128",
|
116
|
+
"mp4": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/giphy-downsized-small.mp4",
|
117
|
+
"mp4_size": "32305"
|
118
|
+
},
|
119
|
+
"fixed_width_downsampled": {
|
120
|
+
"url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/200w_d.gif",
|
121
|
+
"width": "200",
|
122
|
+
"height": "116",
|
123
|
+
"size": "113625",
|
124
|
+
"webp": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/200w_d.webp",
|
125
|
+
"webp_size": "33742"
|
126
|
+
},
|
127
|
+
"downsized_medium": {
|
128
|
+
"url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/giphy.gif",
|
129
|
+
"width": "223",
|
130
|
+
"height": "129",
|
131
|
+
"size": "1478990"
|
105
132
|
},
|
106
133
|
"original": {
|
107
|
-
"url": "
|
108
|
-
"width": "
|
109
|
-
"height": "
|
110
|
-
"size": "
|
111
|
-
"frames": "
|
112
|
-
"mp4": "
|
113
|
-
"mp4_size": "
|
114
|
-
"webp": "
|
115
|
-
"webp_size": "
|
134
|
+
"url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/giphy.gif",
|
135
|
+
"width": "223",
|
136
|
+
"height": "129",
|
137
|
+
"size": "1478990",
|
138
|
+
"frames": "108",
|
139
|
+
"mp4": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/giphy.mp4",
|
140
|
+
"mp4_size": "88305",
|
141
|
+
"webp": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/giphy.webp",
|
142
|
+
"webp_size": "733090"
|
116
143
|
},
|
117
|
-
"
|
118
|
-
"url": "
|
119
|
-
"width": "
|
120
|
-
"height": "
|
144
|
+
"fixed_height": {
|
145
|
+
"url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/200.gif",
|
146
|
+
"width": "346",
|
147
|
+
"height": "200",
|
148
|
+
"size": "5113607",
|
149
|
+
"mp4": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/200.mp4",
|
150
|
+
"mp4_size": "54692",
|
151
|
+
"webp": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/200.webp",
|
152
|
+
"webp_size": "1263464"
|
153
|
+
},
|
154
|
+
"looping": {
|
155
|
+
"mp4": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/giphy-loop.mp4",
|
156
|
+
"mp4_size": "678282"
|
157
|
+
},
|
158
|
+
"original_mp4": {
|
159
|
+
"width": "480",
|
160
|
+
"height": "276",
|
161
|
+
"mp4": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/giphy.mp4",
|
162
|
+
"mp4_size": "88305"
|
163
|
+
},
|
164
|
+
"preview_gif": {
|
165
|
+
"url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/giphy-preview.gif",
|
166
|
+
"width": "121",
|
167
|
+
"height": "70",
|
168
|
+
"size": "49260"
|
121
169
|
}
|
122
170
|
}
|
123
171
|
},
|
124
172
|
"meta": {
|
125
173
|
"status": 200,
|
126
|
-
"msg": "OK"
|
174
|
+
"msg": "OK",
|
175
|
+
"response_id": "599dad7a366d6e534551b31b"
|
127
176
|
}
|
128
177
|
}
|
@@ -10,14 +10,22 @@ describe Lita::Handlers::OnewheelGiphy, lita_handler: true do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
it { is_expected.to route_command('giphy') }
|
13
|
+
it { is_expected.to route_command('gif') }
|
14
|
+
it { is_expected.to route_command('gif x') }
|
13
15
|
it { is_expected.to route_command('giphy soon') }
|
14
16
|
it { is_expected.to route_command('giphytrending') }
|
15
17
|
it { is_expected.to route_command('giphytranslate boom') }
|
16
18
|
|
17
19
|
it 'gets a giphy by string keywords' do
|
18
|
-
mock_fixture('
|
20
|
+
mock_fixture('translate_good')
|
19
21
|
send_command 'giphy wat'
|
20
|
-
expect(replies.last).to eq('
|
22
|
+
expect(replies.last).to eq('https://media1.giphy.com/media/T2NINhwlHgOSk/giphy.gif')
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'gets a gif by string keywords' do
|
26
|
+
mock_fixture('translate_good')
|
27
|
+
send_command 'gif wat'
|
28
|
+
expect(replies.last).to eq('https://media1.giphy.com/media/T2NINhwlHgOSk/giphy.gif')
|
21
29
|
end
|
22
30
|
|
23
31
|
it 'gets a random giphy' do
|
@@ -35,7 +43,7 @@ describe Lita::Handlers::OnewheelGiphy, lita_handler: true do
|
|
35
43
|
it 'gets a translate giphy' do
|
36
44
|
mock_fixture('translate_good')
|
37
45
|
send_command 'giphytranslate boom'
|
38
|
-
expect(replies.last).to eq('
|
46
|
+
expect(replies.last).to eq('https://media1.giphy.com/media/T2NINhwlHgOSk/giphy.gif')
|
39
47
|
end
|
40
48
|
|
41
49
|
def mock_fixture(fixture)
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-onewheel-giphy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kreps
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
165
|
version: '0'
|
166
166
|
requirements: []
|
167
167
|
rubyforge_project:
|
168
|
-
rubygems_version: 2.
|
168
|
+
rubygems_version: 2.5.2
|
169
169
|
signing_key:
|
170
170
|
specification_version: 4
|
171
171
|
summary: Aims to be a complete implementation of the Giphy api. https://github.com/giphy/GiphyAPI
|