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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1cca6070b5f6a3ac4a0e6cd9de0fb304a795f001
4
- data.tar.gz: b71c1fdc67da8c34b2e907742975901fa5fa0bbe
3
+ metadata.gz: ea5fa7cf083a32d35ea2cf48737ff557b375f6c0
4
+ data.tar.gz: beebc189f97b74a11f465051bf4cce5a7d83da82
5
5
  SHA512:
6
- metadata.gz: f8ee579d3f660411dc153a073eae4672a67ef1f8eda22ceb874870968d44ab92d2a5c29d8b824c064750c978e961d150ef4747c0061f72ed860657251248e6dd
7
- data.tar.gz: 37f92e5006874e67e33b2b10409da543065eef48ee285b105c3431c9128c02e43a87dbd92dc1a0aadf8cd28b91081fcc2bbd177791d6e32195bd6bf6753e86a4
6
+ metadata.gz: cbf70766a66276f6a214601f01e9df021602e18b695c2239c6e9248ffd61c6fdc6f3550dcda89f1a8bf9526324caddc44ac180480f5e25f4e1ac68634670ed8a
7
+ data.tar.gz: 53043edb9424498c10534cabbc4b88fe3111699cef98a0663445ff95740994251e92e6dbd7aeb1143ca1f68f412b57bb64e0072aae7f67fab0a0bb8d200b3c05
@@ -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,
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-giphy'
3
- spec.version = '0.4.1'
3
+ spec.version = '0.4.2'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = 'Lita chat interface to giphy api for MOAR GIFS'
@@ -1,128 +1,177 @@
1
1
  {
2
2
  "data": {
3
3
  "type": "gif",
4
- "id": "wWAIKcFASEFz2",
5
- "url": "http://giphy.com/gifs/superman-santa-chandler-bing-wWAIKcFASEFz2",
6
- "bitly_gif_url": "http://gph.is/XMD6gE",
7
- "bitly_url": "http://gph.is/XMD6gE",
8
- "embed_url": "http://giphy.com/embed/wWAIKcFASEFz2",
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://daytripperrevolution.tumblr.com/post/13729531842",
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
- "import_datetime": "2013-03-24 17:48:35",
15
- "trending_datetime": "1970-01-01 00:00:00",
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": "http://media2.giphy.com/media/wWAIKcFASEFz2/200_s.gif",
29
- "width": "358",
21
+ "url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/200_s.gif",
22
+ "width": "346",
30
23
  "height": "200"
31
24
  },
32
- "fixed_height_downsampled": {
33
- "url": "http://media3.giphy.com/media/wWAIKcFASEFz2/200_d.gif",
34
- "width": "358",
35
- "height": "200",
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": "http://media3.giphy.com/media/wWAIKcFASEFz2/200w.gif",
31
+ "url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/200w.gif",
42
32
  "width": "200",
43
- "height": "112",
44
- "size": "51889",
45
- "mp4": "http://media2.giphy.com/media/wWAIKcFASEFz2/200w.mp4",
46
- "mp4_size": "16299",
47
- "webp": "http://media2.giphy.com/media/wWAIKcFASEFz2/200w.webp",
48
- "webp_size": "70302"
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
- "fixed_width_still": {
51
- "url": "http://media1.giphy.com/media/wWAIKcFASEFz2/200w_s.gif",
52
- "width": "200",
53
- "height": "112"
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
- "fixed_width_downsampled": {
56
- "url": "http://media2.giphy.com/media/wWAIKcFASEFz2/200w_d.gif",
57
- "width": "200",
58
- "height": "112",
59
- "size": "131311",
60
- "webp": "http://media2.giphy.com/media/wWAIKcFASEFz2/200w_d.webp",
61
- "webp_size": "60336"
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": "http://media2.giphy.com/media/wWAIKcFASEFz2/100.gif",
65
- "width": "179",
60
+ "url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/100.gif",
61
+ "width": "173",
66
62
  "height": "100",
67
- "size": "126220",
68
- "webp": "http://media2.giphy.com/media/wWAIKcFASEFz2/100.webp",
69
- "webp_size": "56790"
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
- "fixed_height_small_still": {
72
- "url": "http://media2.giphy.com/media/wWAIKcFASEFz2/100_s.gif",
73
- "width": "179",
74
- "height": "100"
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
- "fixed_width_small": {
77
- "url": "http://media2.giphy.com/media/wWAIKcFASEFz2/100w.gif",
78
- "width": "100",
79
- "height": "56",
80
- "size": "51889",
81
- "webp": "http://media2.giphy.com/media/wWAIKcFASEFz2/100w.webp",
82
- "webp_size": "21266"
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": "http://media2.giphy.com/media/wWAIKcFASEFz2/100w_s.gif",
88
+ "url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/100w_s.gif",
86
89
  "width": "100",
87
- "height": "56"
90
+ "height": "58"
88
91
  },
89
- "downsized": {
90
- "url": "http://media0.giphy.com/media/wWAIKcFASEFz2/giphy.gif",
91
- "width": "500",
92
- "height": "279",
93
- "size": "508488"
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
- "downsized_still": {
96
- "url": "http://media2.giphy.com/media/wWAIKcFASEFz2/giphy_s.gif",
97
- "width": "500",
98
- "height": "279"
98
+ "fixed_width_still": {
99
+ "url": "https:\/\/media1.giphy.com\/media\/T2NINhwlHgOSk\/200w_s.gif",
100
+ "width": "200",
101
+ "height": "116"
99
102
  },
100
- "downsized_large": {
101
- "url": "http://media0.giphy.com/media/wWAIKcFASEFz2/giphy.gif",
102
- "width": "500",
103
- "height": "279",
104
- "size": "508488"
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": "http://media0.giphy.com/media/wWAIKcFASEFz2/giphy.gif",
108
- "width": "500",
109
- "height": "279",
110
- "size": "508488",
111
- "frames": "7",
112
- "mp4": "http://media2.giphy.com/media/wWAIKcFASEFz2/giphy.mp4",
113
- "mp4_size": "45225",
114
- "webp": "http://media2.giphy.com/media/wWAIKcFASEFz2/giphy.webp",
115
- "webp_size": "305416"
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
- "original_still": {
118
- "url": "http://media2.giphy.com/media/wWAIKcFASEFz2/giphy_s.gif",
119
- "width": "500",
120
- "height": "279"
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('search_good')
20
+ mock_fixture('translate_good')
19
21
  send_command 'giphy wat'
20
- expect(replies.last).to eq('http://media2.giphy.com/media/FiGiRei2ICzzG/giphy.gif')
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('http://media0.giphy.com/media/wWAIKcFASEFz2/giphy.gif')
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
@@ -1,6 +1,6 @@
1
1
  require 'simplecov'
2
2
  require 'coveralls'
3
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
3
+ SimpleCov.formatters = [
4
4
  SimpleCov::Formatter::HTMLFormatter,
5
5
  Coveralls::SimpleCov::Formatter
6
6
  ]
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.1
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-18 00:00:00.000000000 Z
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.6.11
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