ruby-oembed 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.coveralls.yml +1 -0
- data/CHANGELOG.rdoc +6 -0
- data/Gemfile +2 -0
- data/README.md +104 -0
- data/lib/oembed/providers.rb +5 -3
- data/lib/oembed/providers/embedly_urls.yml +222 -8
- data/lib/oembed/version.rb +2 -2
- data/ruby-oembed.gemspec +3 -3
- data/spec/cassettes/OEmbed_Providers_Slideshare.yml +1199 -0
- data/spec/cassettes/OEmbed_Providers_Twitter.yml +403 -0
- data/spec/provider_discovery_spec.rb +1 -8
- data/spec/provider_spec.rb +0 -7
- data/spec/providers/slideshare_spec.rb +42 -0
- data/spec/providers/twitter_spec.rb +44 -0
- data/spec/spec_helper.rb +10 -0
- data/spec/support/shared_examples_for_providers.rb +39 -0
- metadata +18 -8
- data/README.rdoc +0 -87
@@ -0,0 +1,403 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://api.twitter.com:443/1/statuses/oembed.json?url=https%3A%2F%2Ftwitter.com%2FRailsGirlsSoC%2Fstatus%2F702136612822634496
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
accept-encoding:
|
9
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
10
|
+
user-agent:
|
11
|
+
- Mozilla/5.0 (compatible; ruby-oembed/0.10.0)
|
12
|
+
response: !ruby/struct:VCR::Response
|
13
|
+
status: !ruby/struct:VCR::ResponseStatus
|
14
|
+
code: 200
|
15
|
+
message: OK
|
16
|
+
headers:
|
17
|
+
cache-control:
|
18
|
+
- must-revalidate, max-age=3153600000
|
19
|
+
content-disposition:
|
20
|
+
- attachment; filename=json.json
|
21
|
+
content-length:
|
22
|
+
- '511'
|
23
|
+
content-type:
|
24
|
+
- application/json; charset=utf-8
|
25
|
+
date:
|
26
|
+
- Sun, 22 May 2016 04:42:50 GMT
|
27
|
+
expires:
|
28
|
+
- Tue, 28 Apr 2116 04:42:50 GMT
|
29
|
+
last-modified:
|
30
|
+
- Sun, 22 May 2016 04:42:50 GMT
|
31
|
+
server:
|
32
|
+
- tsa_a
|
33
|
+
set-cookie:
|
34
|
+
- guest_id=v1%3A146389217092127692; Domain=.twitter.com; Path=/; Expires=Tue,
|
35
|
+
22-May-2018 04:42:50 UTC
|
36
|
+
strict-transport-security:
|
37
|
+
- max-age=631138519
|
38
|
+
x-connection-hash:
|
39
|
+
- 94a2de9aaa8f85b2411f08f3a47cd023
|
40
|
+
x-content-type-options:
|
41
|
+
- nosniff
|
42
|
+
x-frame-options:
|
43
|
+
- SAMEORIGIN
|
44
|
+
x-response-time:
|
45
|
+
- '16'
|
46
|
+
x-xss-protection:
|
47
|
+
- 1; mode=block
|
48
|
+
body: !binary |-
|
49
|
+
eyJ1cmwiOiJodHRwczpcL1wvdHdpdHRlci5jb21cL1JhaWxzR2lybHNTb0Nc
|
50
|
+
L3N0YXR1c1wvNzAyMTM2NjEyODIyNjM0NDk2IiwiYXV0aG9yX25hbWUiOiJS
|
51
|
+
YWlscyBHaXJscyBTb0MiLCJhdXRob3JfdXJsIjoiaHR0cHM6XC9cL3R3aXR0
|
52
|
+
ZXIuY29tXC9SYWlsc0dpcmxzU29DIiwiaHRtbCI6Ilx1MDAzQ2Jsb2NrcXVv
|
53
|
+
dGUgY2xhc3M9XCJ0d2l0dGVyLXR3ZWV0XCJcdTAwM0VcdTAwM0NwIGxhbmc9
|
54
|
+
XCJlblwiIGRpcj1cImx0clwiXHUwMDNFT3VyIDIwMTYgZnVuZHJhaXNpbmcg
|
55
|
+
Y2FtcGFpZ24gaXMgbm93IG9wZW4hISBMZXTigJlzIG1ha2UgYW5vdGhlciBh
|
56
|
+
bWF6aW5nIHN1bW1lciBoYXBwZW4h4pyoXHVEODNEXHVEQzlDXHVEODNEXHVE
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1'
|
73
|
+
- !ruby/struct:VCR::HTTPInteraction
|
74
|
+
request: !ruby/struct:VCR::Request
|
75
|
+
method: :get
|
76
|
+
uri: https://api.twitter.com:443/1/statuses/oembed.json?url=https%3A%2F%2Fwww.twitter.com%2Fbpoweski%2Fstatus%2F71633762
|
77
|
+
body:
|
78
|
+
headers:
|
79
|
+
accept-encoding:
|
80
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
81
|
+
user-agent:
|
82
|
+
- Mozilla/5.0 (compatible; ruby-oembed/0.10.0)
|
83
|
+
response: !ruby/struct:VCR::Response
|
84
|
+
status: !ruby/struct:VCR::ResponseStatus
|
85
|
+
code: 200
|
86
|
+
message: OK
|
87
|
+
headers:
|
88
|
+
cache-control:
|
89
|
+
- must-revalidate, max-age=3153600000
|
90
|
+
content-disposition:
|
91
|
+
- attachment; filename=json.json
|
92
|
+
content-length:
|
93
|
+
- '377'
|
94
|
+
content-type:
|
95
|
+
- application/json; charset=utf-8
|
96
|
+
date:
|
97
|
+
- Sun, 22 May 2016 04:42:51 GMT
|
98
|
+
expires:
|
99
|
+
- Tue, 28 Apr 2116 04:42:51 GMT
|
100
|
+
last-modified:
|
101
|
+
- Sun, 22 May 2016 04:42:51 GMT
|
102
|
+
server:
|
103
|
+
- tsa_a
|
104
|
+
set-cookie:
|
105
|
+
- guest_id=v1%3A146389217180318801; Domain=.twitter.com; Path=/; Expires=Tue,
|
106
|
+
22-May-2018 04:42:51 UTC
|
107
|
+
strict-transport-security:
|
108
|
+
- max-age=631138519
|
109
|
+
x-connection-hash:
|
110
|
+
- 7a694516718ce415b38581035d0967e0
|
111
|
+
x-content-type-options:
|
112
|
+
- nosniff
|
113
|
+
x-frame-options:
|
114
|
+
- SAMEORIGIN
|
115
|
+
x-response-time:
|
116
|
+
- '15'
|
117
|
+
x-xss-protection:
|
118
|
+
- 1; mode=block
|
119
|
+
body: '{"url":"https:\/\/twitter.com\/bpoweski\/status\/71633762","author_name":"Ben
|
120
|
+
Poweski","author_url":"https:\/\/twitter.com\/bpoweski","html":"\u003Cblockquote
|
121
|
+
class=\"twitter-tweet\"\u003E\u003Cp lang=\"en\" dir=\"ltr\"\u003Eworking on
|
122
|
+
my Ruby Security book\u003C\/p\u003E— Ben Poweski (@bpoweski) \u003Ca
|
123
|
+
href=\"https:\/\/twitter.com\/bpoweski\/status\/71633762\"\u003EMay 20, 2007\u003C\/a\u003E\u003C\/blockquote\u003E\n\u003Cscript
|
124
|
+
async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"\u003E\u003C\/script\u003E","width":550,"type":"rich","cache_age":"3153600000","provider_name":"Twitter","provider_url":"https:\/\/twitter.com","height":null,"version":"1.0"}'
|
125
|
+
http_version: '1.1'
|
126
|
+
- !ruby/struct:VCR::HTTPInteraction
|
127
|
+
request: !ruby/struct:VCR::Request
|
128
|
+
method: :get
|
129
|
+
uri: https://api.twitter.com:443/1/statuses/oembed.xml?url=https%3A%2F%2Ftwitter.com%2FRailsGirlsSoC%2Fstatus%2F702136612822634496
|
130
|
+
body:
|
131
|
+
headers:
|
132
|
+
accept-encoding:
|
133
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
134
|
+
user-agent:
|
135
|
+
- Mozilla/5.0 (compatible; ruby-oembed/0.10.0)
|
136
|
+
response: !ruby/struct:VCR::Response
|
137
|
+
status: !ruby/struct:VCR::ResponseStatus
|
138
|
+
code: 410
|
139
|
+
message: Gone
|
140
|
+
headers:
|
141
|
+
content-length:
|
142
|
+
- '181'
|
143
|
+
content-type:
|
144
|
+
- application/xml;charset=utf-8
|
145
|
+
date:
|
146
|
+
- Sun, 22 May 2016 04:47:50 GMT
|
147
|
+
server:
|
148
|
+
- tsa_a
|
149
|
+
set-cookie:
|
150
|
+
- guest_id=v1%3A146389247047875048; Domain=.twitter.com; Path=/; Expires=Tue,
|
151
|
+
22-May-2018 04:47:50 UTC
|
152
|
+
strict-transport-security:
|
153
|
+
- max-age=631138519
|
154
|
+
x-connection-hash:
|
155
|
+
- 4362d0593f7be75dc40b9a6f51ada770
|
156
|
+
x-response-time:
|
157
|
+
- '2'
|
158
|
+
body: <?xml version="1.0" encoding="UTF-8"?><errors> <error code="64">The Twitter
|
159
|
+
REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.</error></errors>
|
160
|
+
http_version: '1.1'
|
161
|
+
- !ruby/struct:VCR::HTTPInteraction
|
162
|
+
request: !ruby/struct:VCR::Request
|
163
|
+
method: :get
|
164
|
+
uri: https://api.twitter.com:443/1/statuses/oembed.xml?url=https%3A%2F%2Fwww.twitter.com%2Fbpoweski%2Fstatus%2F71633762
|
165
|
+
body:
|
166
|
+
headers:
|
167
|
+
accept-encoding:
|
168
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
169
|
+
user-agent:
|
170
|
+
- Mozilla/5.0 (compatible; ruby-oembed/0.10.0)
|
171
|
+
response: !ruby/struct:VCR::Response
|
172
|
+
status: !ruby/struct:VCR::ResponseStatus
|
173
|
+
code: 410
|
174
|
+
message: Gone
|
175
|
+
headers:
|
176
|
+
content-length:
|
177
|
+
- '181'
|
178
|
+
content-type:
|
179
|
+
- application/xml;charset=utf-8
|
180
|
+
date:
|
181
|
+
- Sun, 22 May 2016 04:47:50 GMT
|
182
|
+
server:
|
183
|
+
- tsa_a
|
184
|
+
set-cookie:
|
185
|
+
- guest_id=v1%3A146389247091551370; Domain=.twitter.com; Path=/; Expires=Tue,
|
186
|
+
22-May-2018 04:47:50 UTC
|
187
|
+
strict-transport-security:
|
188
|
+
- max-age=631138519
|
189
|
+
x-connection-hash:
|
190
|
+
- 0ad11ae6624c326369f0b9f878dd4faa
|
191
|
+
x-response-time:
|
192
|
+
- '3'
|
193
|
+
body: <?xml version="1.0" encoding="UTF-8"?><errors> <error code="64">The Twitter
|
194
|
+
REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.</error></errors>
|
195
|
+
http_version: '1.1'
|
196
|
+
- !ruby/struct:VCR::HTTPInteraction
|
197
|
+
request: !ruby/struct:VCR::Request
|
198
|
+
method: :get
|
199
|
+
uri: https://publish.twitter.com:443/oembed?url=https%3A%2F%2Ftwitter.com%2FRailsGirlsSoC%2Fstatus%2F702136612822634496&format=json
|
200
|
+
body:
|
201
|
+
headers:
|
202
|
+
accept-encoding:
|
203
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
204
|
+
user-agent:
|
205
|
+
- Mozilla/5.0 (compatible; ruby-oembed/0.10.0)
|
206
|
+
response: !ruby/struct:VCR::Response
|
207
|
+
status: !ruby/struct:VCR::ResponseStatus
|
208
|
+
code: 200
|
209
|
+
message: OK
|
210
|
+
headers:
|
211
|
+
cache-control:
|
212
|
+
- must-revalidate, max-age=3153600000
|
213
|
+
content-disposition:
|
214
|
+
- attachment; filename=json.json
|
215
|
+
content-length:
|
216
|
+
- '511'
|
217
|
+
content-type:
|
218
|
+
- application/json; charset=utf-8
|
219
|
+
date:
|
220
|
+
- Sun, 22 May 2016 05:28:56 GMT
|
221
|
+
expires:
|
222
|
+
- Tue, 28 Apr 2116 05:28:56 GMT
|
223
|
+
last-modified:
|
224
|
+
- Sun, 22 May 2016 05:28:56 GMT
|
225
|
+
server:
|
226
|
+
- tsa_a
|
227
|
+
set-cookie:
|
228
|
+
- guest_id=v1%3A146389493674598630; Domain=.twitter.com; Path=/; Expires=Tue,
|
229
|
+
22-May-2018 05:28:56 UTC
|
230
|
+
strict-transport-security:
|
231
|
+
- max-age=631138519
|
232
|
+
x-connection-hash:
|
233
|
+
- af69b197ce2eeb32bfa62ea1f1c8647e
|
234
|
+
x-content-type-options:
|
235
|
+
- nosniff
|
236
|
+
x-frame-options:
|
237
|
+
- SAMEORIGIN
|
238
|
+
x-response-time:
|
239
|
+
- '35'
|
240
|
+
x-xss-protection:
|
241
|
+
- 1; mode=block
|
242
|
+
body: !binary |-
|
243
|
+
eyJ1cmwiOiJodHRwczpcL1wvdHdpdHRlci5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dTAwM0VGZWJy
|
259
|
+
dWFyeSAyMywgMjAxNlx1MDAzQ1wvYVx1MDAzRVx1MDAzQ1wvYmxvY2txdW90
|
260
|
+
ZVx1MDAzRVxuXHUwMDNDc2NyaXB0IGFzeW5jIHNyYz1cIlwvXC9wbGF0Zm9y
|
261
|
+
bS50d2l0dGVyLmNvbVwvd2lkZ2V0cy5qc1wiIGNoYXJzZXQ9XCJ1dGYtOFwi
|
262
|
+
XHUwMDNFXHUwMDNDXC9zY3JpcHRcdTAwM0UiLCJ3aWR0aCI6NTUwLCJ0eXBl
|
263
|
+
IjoicmljaCIsImNhY2hlX2FnZSI6IjMxNTM2MDAwMDAiLCJwcm92aWRlcl9u
|
264
|
+
YW1lIjoiVHdpdHRlciIsInByb3ZpZGVyX3VybCI6Imh0dHBzOlwvXC90d2l0
|
265
|
+
dGVyLmNvbSIsImhlaWdodCI6bnVsbCwidmVyc2lvbiI6IjEuMCJ9
|
266
|
+
http_version: '1.1'
|
267
|
+
- !ruby/struct:VCR::HTTPInteraction
|
268
|
+
request: !ruby/struct:VCR::Request
|
269
|
+
method: :get
|
270
|
+
uri: https://publish.twitter.com:443/oembed?url=https%3A%2F%2Fwww.twitter.com%2Fbpoweski%2Fstatus%2F71633762&format=json
|
271
|
+
body:
|
272
|
+
headers:
|
273
|
+
accept-encoding:
|
274
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
275
|
+
user-agent:
|
276
|
+
- Mozilla/5.0 (compatible; ruby-oembed/0.10.0)
|
277
|
+
response: !ruby/struct:VCR::Response
|
278
|
+
status: !ruby/struct:VCR::ResponseStatus
|
279
|
+
code: 200
|
280
|
+
message: OK
|
281
|
+
headers:
|
282
|
+
cache-control:
|
283
|
+
- must-revalidate, max-age=3153600000
|
284
|
+
content-disposition:
|
285
|
+
- attachment; filename=json.json
|
286
|
+
content-length:
|
287
|
+
- '377'
|
288
|
+
content-type:
|
289
|
+
- application/json; charset=utf-8
|
290
|
+
date:
|
291
|
+
- Sun, 22 May 2016 05:28:58 GMT
|
292
|
+
expires:
|
293
|
+
- Tue, 28 Apr 2116 05:28:58 GMT
|
294
|
+
last-modified:
|
295
|
+
- Sun, 22 May 2016 05:28:58 GMT
|
296
|
+
server:
|
297
|
+
- tsa_a
|
298
|
+
set-cookie:
|
299
|
+
- guest_id=v1%3A146389493840609737; Domain=.twitter.com; Path=/; Expires=Tue,
|
300
|
+
22-May-2018 05:28:58 UTC
|
301
|
+
strict-transport-security:
|
302
|
+
- max-age=631138519
|
303
|
+
x-connection-hash:
|
304
|
+
- 753e3b3ca5ace007543400fc1a736700
|
305
|
+
x-content-type-options:
|
306
|
+
- nosniff
|
307
|
+
x-frame-options:
|
308
|
+
- SAMEORIGIN
|
309
|
+
x-response-time:
|
310
|
+
- '15'
|
311
|
+
x-xss-protection:
|
312
|
+
- 1; mode=block
|
313
|
+
body: '{"url":"https:\/\/twitter.com\/bpoweski\/status\/71633762","author_name":"Ben
|
314
|
+
Poweski","author_url":"https:\/\/twitter.com\/bpoweski","html":"\u003Cblockquote
|
315
|
+
class=\"twitter-tweet\"\u003E\u003Cp lang=\"en\" dir=\"ltr\"\u003Eworking on
|
316
|
+
my Ruby Security book\u003C\/p\u003E— Ben Poweski (@bpoweski) \u003Ca
|
317
|
+
href=\"https:\/\/twitter.com\/bpoweski\/status\/71633762\"\u003EMay 20, 2007\u003C\/a\u003E\u003C\/blockquote\u003E\n\u003Cscript
|
318
|
+
async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"\u003E\u003C\/script\u003E","width":550,"type":"rich","cache_age":"3153600000","provider_name":"Twitter","provider_url":"https:\/\/twitter.com","height":null,"version":"1.0"}'
|
319
|
+
http_version: '1.1'
|
320
|
+
- !ruby/struct:VCR::HTTPInteraction
|
321
|
+
request: !ruby/struct:VCR::Request
|
322
|
+
method: :get
|
323
|
+
uri: https://publish.twitter.com:443/oembed?url=https%3A%2F%2Ftwitter.com%2FRailsGirlsSoC%2Fstatus%2F702136612822634496&format=xml
|
324
|
+
body:
|
325
|
+
headers:
|
326
|
+
accept-encoding:
|
327
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
328
|
+
user-agent:
|
329
|
+
- Mozilla/5.0 (compatible; ruby-oembed/0.10.0)
|
330
|
+
response: !ruby/struct:VCR::Response
|
331
|
+
status: !ruby/struct:VCR::ResponseStatus
|
332
|
+
code: 400
|
333
|
+
message: Bad Request
|
334
|
+
headers:
|
335
|
+
content-disposition:
|
336
|
+
- attachment; filename=json.json
|
337
|
+
content-length:
|
338
|
+
- '60'
|
339
|
+
content-type:
|
340
|
+
- application/json; charset=utf-8
|
341
|
+
date:
|
342
|
+
- Sun, 22 May 2016 05:28:58 GMT
|
343
|
+
server:
|
344
|
+
- tsa_a
|
345
|
+
set-cookie:
|
346
|
+
- guest_id=v1%3A146389493885489875; Domain=.twitter.com; Path=/; Expires=Tue,
|
347
|
+
22-May-2018 05:28:58 UTC
|
348
|
+
strict-transport-security:
|
349
|
+
- max-age=631138519
|
350
|
+
x-connection-hash:
|
351
|
+
- a457da9c9aa85d3abd203831bbbb83d3
|
352
|
+
x-content-type-options:
|
353
|
+
- nosniff
|
354
|
+
x-frame-options:
|
355
|
+
- SAMEORIGIN
|
356
|
+
x-response-time:
|
357
|
+
- '7'
|
358
|
+
x-xss-protection:
|
359
|
+
- 1; mode=block
|
360
|
+
body: '{"errors":["xml not implemented"]}'
|
361
|
+
http_version: '1.1'
|
362
|
+
- !ruby/struct:VCR::HTTPInteraction
|
363
|
+
request: !ruby/struct:VCR::Request
|
364
|
+
method: :get
|
365
|
+
uri: https://publish.twitter.com:443/oembed?url=https%3A%2F%2Fwww.twitter.com%2Fbpoweski%2Fstatus%2F71633762&format=xml
|
366
|
+
body:
|
367
|
+
headers:
|
368
|
+
accept-encoding:
|
369
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
370
|
+
user-agent:
|
371
|
+
- Mozilla/5.0 (compatible; ruby-oembed/0.10.0)
|
372
|
+
response: !ruby/struct:VCR::Response
|
373
|
+
status: !ruby/struct:VCR::ResponseStatus
|
374
|
+
code: 400
|
375
|
+
message: Bad Request
|
376
|
+
headers:
|
377
|
+
content-disposition:
|
378
|
+
- attachment; filename=json.json
|
379
|
+
content-length:
|
380
|
+
- '60'
|
381
|
+
content-type:
|
382
|
+
- application/json; charset=utf-8
|
383
|
+
date:
|
384
|
+
- Sun, 22 May 2016 05:28:59 GMT
|
385
|
+
server:
|
386
|
+
- tsa_a
|
387
|
+
set-cookie:
|
388
|
+
- guest_id=v1%3A146389493910837135; Domain=.twitter.com; Path=/; Expires=Tue,
|
389
|
+
22-May-2018 05:28:59 UTC
|
390
|
+
strict-transport-security:
|
391
|
+
- max-age=631138519
|
392
|
+
x-connection-hash:
|
393
|
+
- 3543953c1c553fbcf1c441417b26f66d
|
394
|
+
x-content-type-options:
|
395
|
+
- nosniff
|
396
|
+
x-frame-options:
|
397
|
+
- SAMEORIGIN
|
398
|
+
x-response-time:
|
399
|
+
- '6'
|
400
|
+
x-xss-protection:
|
401
|
+
- 1; mode=block
|
402
|
+
body: '{"errors":["xml not implemented"]}'
|
403
|
+
http_version: '1.1'
|
@@ -1,12 +1,5 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/spec_helper'
|
2
2
|
require 'json'
|
3
|
-
require 'vcr'
|
4
|
-
|
5
|
-
VCR.config do |c|
|
6
|
-
c.default_cassette_options = { :record => :new_episodes }
|
7
|
-
c.cassette_library_dir = 'spec/cassettes'
|
8
|
-
c.stub_with :fakeweb
|
9
|
-
end
|
10
3
|
|
11
4
|
describe OEmbed::ProviderDiscovery do
|
12
5
|
before(:all) do
|
@@ -50,7 +43,7 @@ describe OEmbed::ProviderDiscovery do
|
|
50
43
|
{:json=>'http://www.noteflight.com/services/oembed', :xml=>'http://www.noteflight.com/services/oembed'},
|
51
44
|
:json,
|
52
45
|
],
|
53
|
-
# TODO: Enhance ProviderDiscovery to support arbitrary query parameters. See https://github.com/
|
46
|
+
# TODO: Enhance ProviderDiscovery to support arbitrary query parameters. See https://github.com/ruby-oembed/ruby-oembed/issues/15
|
54
47
|
#'wordpress' => [
|
55
48
|
# 'http://sweetandweak.wordpress.com/2011/09/23/nothing-starts-the-morning-like-a-good-dose-of-panic/',
|
56
49
|
# {:json=>'https://public-api.wordpress.com/oembed/1.0/', :xml=>'https://public-api.wordpress.com/oembed/1.0/'},
|
data/spec/provider_spec.rb
CHANGED
@@ -1,11 +1,4 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
-
require 'vcr'
|
3
|
-
|
4
|
-
VCR.config do |c|
|
5
|
-
c.default_cassette_options = { :record => :new_episodes }
|
6
|
-
c.cassette_library_dir = 'spec/cassettes'
|
7
|
-
c.stub_with :fakeweb
|
8
|
-
end
|
9
2
|
|
10
3
|
describe OEmbed::Provider do
|
11
4
|
before(:all) do
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '../spec_helper')
|
2
|
+
require 'support/shared_examples_for_providers'
|
3
|
+
|
4
|
+
describe 'OEmbed::Providers::Slideshare' do
|
5
|
+
before(:all) do
|
6
|
+
VCR.insert_cassette('OEmbed_Providers_Slideshare')
|
7
|
+
end
|
8
|
+
after(:all) do
|
9
|
+
VCR.eject_cassette
|
10
|
+
end
|
11
|
+
|
12
|
+
include OEmbedSpecHelper
|
13
|
+
|
14
|
+
let(:provider_class) { OEmbed::Providers::Slideshare }
|
15
|
+
|
16
|
+
expected_valid_urls = (
|
17
|
+
%w(https:// http://).map do |protocol|
|
18
|
+
%w(slideshare.net www.slideshare.net de.slideshare.net).map do |host|
|
19
|
+
[
|
20
|
+
'/gabriele.lana/the-magic-of-elixir',
|
21
|
+
# Even though Slideshare's oEmbed endpoint
|
22
|
+
# is supposed to /mobile/ URLs,
|
23
|
+
# as of 2016-05-21 it's returning 404 results for these URLs.
|
24
|
+
#'/mobile/gabriele.lana/the-magic-of-elixir',
|
25
|
+
].map do |path|
|
26
|
+
File.join(protocol, host, path)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
).flatten
|
31
|
+
|
32
|
+
expected_invalid_urls = %w(
|
33
|
+
http://www.slideshare.net
|
34
|
+
http://www.slideshare.net/gabriele.lana
|
35
|
+
)
|
36
|
+
|
37
|
+
it_should_behave_like(
|
38
|
+
"an OEmbed::Proviers instance",
|
39
|
+
expected_valid_urls,
|
40
|
+
expected_invalid_urls
|
41
|
+
)
|
42
|
+
end
|