ruby-oembed 0.8.7 → 0.8.8
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.
- data/.gitignore +7 -0
- data/CHANGELOG.rdoc +9 -0
- data/Gemfile +2 -11
- data/Rakefile +4 -26
- data/lib/oembed/provider.rb +4 -2
- data/lib/oembed/providers/embedly_urls.yml +76 -17
- data/lib/oembed/providers.rb +25 -9
- data/lib/oembed/response/photo.rb +2 -2
- data/lib/oembed/version.rb +1 -1
- data/lib/tasks/oembed.rake +1 -1
- data/ruby-oembed.gemspec +15 -69
- data/spec/cassettes/OEmbed_Provider.yml +6 -6
- data/spec/cassettes/OEmbed_ProviderDiscovery.yml +6 -6
- data/spec/provider_spec.rb +13 -2
- data/spec/response_spec.rb +115 -66
- data/spec/spec_helper_examples.yml +3 -0
- metadata +69 -28
- data/Gemfile.lock +0 -36
data/.gitignore
ADDED
data/CHANGELOG.rdoc
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
= CHANGELOG
|
2
2
|
|
3
|
+
== 0.8.8 - 18 November 2012
|
4
|
+
|
5
|
+
* OEmbed::Response::Photo#html now includes alt attribute; Pull #23 & #25 (François de Metz)
|
6
|
+
* Always escape the url query param when requesting a resource from a provider; Pull #26 (Michael Cohen)
|
7
|
+
* Allow query params in a provider endpoint URL; Pull #27 (Michael Andrews)
|
8
|
+
* Added built-in provider for Skitch; Pull #24 (François de Metz)
|
9
|
+
* Updated built-in Vimeo provider (Marcos Wright Kuhns)
|
10
|
+
* For developers who work on this gem, removed the dependency on jeweler (Marcos Wright Kuhns)
|
11
|
+
|
3
12
|
== 0.8.7 - 11 March 2012
|
4
13
|
|
5
14
|
* Support for https provider endpoints; Issue #16 (Marcos Wright Kuhns)
|
data/Gemfile
CHANGED
@@ -1,12 +1,3 @@
|
|
1
|
-
source
|
1
|
+
source "https://rubygems.org"
|
2
2
|
|
3
|
-
|
4
|
-
gem 'jeweler'
|
5
|
-
gem 'rake'
|
6
|
-
gem 'json'
|
7
|
-
gem 'xml-simple'
|
8
|
-
gem 'nokogiri'
|
9
|
-
gem 'rspec', '>=2.0'
|
10
|
-
gem 'vcr', '~> 1.0'
|
11
|
-
gem 'fakeweb' # For use with vcr.
|
12
|
-
end
|
3
|
+
gemspec
|
data/Rakefile
CHANGED
@@ -1,29 +1,7 @@
|
|
1
|
-
require File.expand_path(File.join(__FILE__, '../lib/oembed/version'))
|
2
|
-
|
3
1
|
begin
|
4
|
-
require
|
5
|
-
|
6
|
-
Dir[File.join(File.dirname(__FILE__), "lib/tasks/*.rake")].sort.each { |ext| load ext }
|
7
|
-
|
8
|
-
Jeweler::Tasks.new do |gemspec|
|
9
|
-
gemspec.name = "ruby-oembed"
|
10
|
-
gemspec.version = OEmbed::Version
|
11
|
-
gemspec.homepage = "http://github.com/judofyr/ruby-oembed"
|
12
|
-
gemspec.summary = "oEmbed for Ruby"
|
13
|
-
gemspec.description = "An oEmbed consumer library written in Ruby, letting you easily get embeddable HTML representations of supported web pages, based on their URLs. See http://oembed.com for more information about the protocol."
|
14
|
-
gemspec.license = "MIT"
|
15
|
-
gemspec.email = "arisbartee@gmail.com"
|
16
|
-
gemspec.authors = ["Magnus Holm","Alex Kessinger","Aris Bartee","Marcos Wright Kuhns"]
|
17
|
-
|
18
|
-
gemspec.rdoc_options = %W(
|
19
|
-
--main README.rdoc
|
20
|
-
--title #{gemspec.full_name}
|
21
|
-
--inline-source
|
22
|
-
--exclude tasks
|
23
|
-
CHANGELOG.rdoc
|
24
|
-
)
|
25
|
-
end
|
26
|
-
Jeweler::RubygemsDotOrgTasks.new
|
2
|
+
require "bundler/gem_tasks"
|
27
3
|
rescue LoadError
|
28
|
-
puts "
|
4
|
+
puts "Bundler not available. Install it with: gem install bundler"
|
29
5
|
end
|
6
|
+
|
7
|
+
Dir[File.join(File.dirname(__FILE__), "lib/tasks/*.rake")].sort.each { |ext| load ext }
|
data/lib/oembed/provider.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'cgi'
|
1
2
|
module OEmbed
|
2
3
|
# An OEmbed::Provider has information about an individual oEmbed enpoint.
|
3
4
|
class Provider
|
@@ -94,7 +95,7 @@ module OEmbed
|
|
94
95
|
def build(url, query = {})
|
95
96
|
raise OEmbed::NotFound, url unless include?(url)
|
96
97
|
|
97
|
-
query = query.merge({:url=>url})
|
98
|
+
query = query.merge({:url => ::CGI.escape(url)})
|
98
99
|
# TODO: move this code exclusively into the get method, once build is private.
|
99
100
|
this_format = (query[:format] ||= @format.to_s).to_s
|
100
101
|
|
@@ -105,7 +106,8 @@ module OEmbed
|
|
105
106
|
query.delete(:format)
|
106
107
|
end
|
107
108
|
|
108
|
-
|
109
|
+
base = endpoint.include?('?') ? '&' : '?'
|
110
|
+
query = base + query.inject("") do |memo, (key, value)|
|
109
111
|
"#{key}=#{value}&#{memo}"
|
110
112
|
end.chop
|
111
113
|
|
@@ -19,6 +19,9 @@
|
|
19
19
|
- http://*.dipdive.com/media/*
|
20
20
|
- http://*.dipdive.com/v/*
|
21
21
|
- http://*.kinomap.com/*
|
22
|
+
- http://*.linkedin.com/in/*
|
23
|
+
- http://*.linkedin.com/pub/*
|
24
|
+
- http://*.looplogic.com/*
|
22
25
|
- http://*.posterous.com/*
|
23
26
|
- http://*.smugmug.com/*
|
24
27
|
- http://*.smugmug.com/*#*
|
@@ -28,6 +31,10 @@
|
|
28
31
|
- http://*.tumblr.com/post/*
|
29
32
|
- http://*.twitrpix.com/*
|
30
33
|
- http://*.uservoice.com/*/suggestions/*
|
34
|
+
- http://*.vzaar.me/*
|
35
|
+
- http://*.wi.st/*
|
36
|
+
- http://*.wikipedia.org/wiki/*
|
37
|
+
- http://*.wistia.com/*
|
31
38
|
- http://*.youtube.com/*#*/*
|
32
39
|
- http://*.youtube.com/playlist*
|
33
40
|
- http://*.youtube.com/profile*
|
@@ -55,10 +62,11 @@
|
|
55
62
|
- http://*twitch.tv/*
|
56
63
|
- http://*twitch.tv/*/b/*
|
57
64
|
- http://*twitvid.com/*
|
58
|
-
- http://*viddler.com/
|
65
|
+
- http://*viddler.com/v/*
|
59
66
|
- http://*yfrog.*/*
|
60
67
|
- http://*youtube.com/watch*
|
61
68
|
- http://23hq.com/*/photo/*
|
69
|
+
- http://360.io/*
|
62
70
|
- http://4sq.com/*
|
63
71
|
- http://99dollarmusicvideos.com/*/episode/*
|
64
72
|
- http://99dollarmusicvideos.com/episode/*
|
@@ -72,7 +80,9 @@
|
|
72
80
|
- http://aniboom.com/animation-video/*
|
73
81
|
- http://animal.discovery.com/videos/*
|
74
82
|
- http://animoto.com/play/*
|
83
|
+
- http://answers.polldaddy.com/poll/*
|
75
84
|
- http://api.shopstyle.com/action/apiVisitRetailer*
|
85
|
+
- http://app.sliderocket.com/*
|
76
86
|
- http://app.wistia.com/embed/medias/*
|
77
87
|
- http://asofterworld.com/*.jpg
|
78
88
|
- http://audioboo.fm/boos/*
|
@@ -83,6 +93,8 @@
|
|
83
93
|
- http://barelydigital.com/episode/*
|
84
94
|
- http://barelypolitical.com/*/episode/*
|
85
95
|
- http://barelypolitical.com/episode/*
|
96
|
+
- http://behance.net/gallery/*
|
97
|
+
- http://beta-sliderocket.com/*
|
86
98
|
- http://bigthink.com/ideas/*
|
87
99
|
- http://bigthink.com/series/*
|
88
100
|
- http://blip.tv/*/*
|
@@ -107,13 +119,18 @@
|
|
107
119
|
- http://collegehumor.com/video/*
|
108
120
|
- http://collegehumor.com/video:*
|
109
121
|
- http://color.com/s/*
|
122
|
+
- http://confreaks.com/videos/*
|
110
123
|
- http://confreaks.net/videos/*
|
124
|
+
- http://coub.com/embed/*
|
125
|
+
- http://coub.com/view/*
|
111
126
|
- http://crocodoc.com/*
|
112
127
|
- http://crunchbase.com/*/*
|
128
|
+
- http://d.pr/i/*
|
113
129
|
- http://dailybooth.com/*/*
|
114
130
|
- http://dipdive.com/media/*
|
115
131
|
- http://dipdive.com/member/*/media/*
|
116
132
|
- http://dipdive.com/v/*
|
133
|
+
- http://distrify.com/film/*
|
117
134
|
- http://dotsub.com/view/*
|
118
135
|
- http://drbl.in/*
|
119
136
|
- http://dsc.discovery.com/videos/*
|
@@ -136,13 +153,12 @@
|
|
136
153
|
- http://freemusicarchive.org/music/*
|
137
154
|
- http://funnyordie.com/m/*
|
138
155
|
- http://funnyordie.com/videos/*
|
139
|
-
- http://gametrailers.com/video
|
156
|
+
- http://gametrailers.com/video*
|
140
157
|
- http://gist.github.com/*
|
141
158
|
- http://godtube.com/featured/video/*
|
142
159
|
- http://godtube.com/watch/*
|
143
|
-
- http://google.com/buzz/*
|
144
|
-
- http://google.com/buzz/*/*/*
|
145
160
|
- http://google.com/profiles/*
|
161
|
+
- http://gopollgo.com/*
|
146
162
|
- http://graphicly.com/*/*/*
|
147
163
|
- http://grindtv.com/*/video/*
|
148
164
|
- http://grooveshark.com/*
|
@@ -168,8 +184,13 @@
|
|
168
184
|
- http://investigation.discovery.com/videos/*
|
169
185
|
- http://issuu.com/*/docs/*
|
170
186
|
- http://itunes.apple.com/*
|
187
|
+
- http://jdsupra.com/legalnews/*
|
188
|
+
- http://jibjab.com/view/*
|
189
|
+
- http://khanacademy.org/*
|
171
190
|
- http://lightbox.com/*
|
172
191
|
- http://link.brightcove.com/services/player/bcpid*
|
192
|
+
- http://linkedin.com/in/*
|
193
|
+
- http://linkedin.com/pub/*
|
173
194
|
- http://liveleak.com/view?*
|
174
195
|
- http://lockerz.com/s/*
|
175
196
|
- http://logotv.com/video/*
|
@@ -196,10 +217,14 @@
|
|
196
217
|
- http://movies.yahoo.com/movie/*/trailer
|
197
218
|
- http://movies.yahoo.com/movie/*/video
|
198
219
|
- http://movies.yahoo.com/movie/*/video/*
|
220
|
+
- http://muvi.es/*
|
199
221
|
- http://my.opera.com/*/albums/show.dml?id=*
|
200
222
|
- http://my.opera.com/*/albums/showpic.dml?album=*&picture=*
|
201
223
|
- http://myloc.me/*
|
202
224
|
- http://nzonscreen.com/title/*
|
225
|
+
- http://on.aol.com/playlist/*
|
226
|
+
- http://on.aol.com/video/*
|
227
|
+
- http://open.spotify.com/*
|
203
228
|
- http://ow.ly/i/*
|
204
229
|
- http://pastebin.com/*
|
205
230
|
- http://pastie.org/*
|
@@ -210,13 +235,17 @@
|
|
210
235
|
- http://picasaweb.google.com*/*/*
|
211
236
|
- http://picasaweb.google.com*/*/*#*
|
212
237
|
- http://picasaweb.google.com*/lh/photo/*
|
213
|
-
- http://picplz.com/*
|
214
238
|
- http://pics.brizzly.com/*.jpg
|
239
|
+
- http://pics.lockerz.com/s/*
|
215
240
|
- http://pikchur.com/*
|
216
241
|
- http://ping.fm/p/*
|
217
242
|
- http://pinterest.com/pin/*
|
218
243
|
- http://pixorial.com/watch/*
|
219
244
|
- http://planetgreen.discovery.com/videos/*
|
245
|
+
- http://plus.google.com/*
|
246
|
+
- http://polldaddy.com/community/poll/*
|
247
|
+
- http://polldaddy.com/poll/*
|
248
|
+
- http://portal.sliderocket.com/*
|
220
249
|
- http://post.ly/*
|
221
250
|
- http://prezi.com/*/*
|
222
251
|
- http://qik.com/*
|
@@ -243,9 +272,10 @@
|
|
243
272
|
- http://sendables.jibjab.com/originals/*
|
244
273
|
- http://sendables.jibjab.com/view/*
|
245
274
|
- http://share.ovi.com/media/*/*
|
246
|
-
- http://
|
275
|
+
- http://showme.com/sh/*
|
247
276
|
- http://siteanalytics.compete.com/*
|
248
277
|
- http://skitch.com/*/*/*
|
278
|
+
- http://sliderocket.com/*
|
249
279
|
- http://slidesha.re/*
|
250
280
|
- http://snd.sc/*
|
251
281
|
- http://snotr.com/video/*
|
@@ -258,6 +288,7 @@
|
|
258
288
|
- http://soundcloud.com/groups/*
|
259
289
|
- http://speakerdeck.com/u/*/p/*
|
260
290
|
- http://sports.yahoo.com/video/*
|
291
|
+
- http://spreecast.com/events/*
|
261
292
|
- http://statsheet.com/*/teams/*/*
|
262
293
|
- http://statsheet.com/statplot/charts/*/*/*/*
|
263
294
|
- http://statsheet.com/statplot/charts/e/*
|
@@ -265,9 +296,7 @@
|
|
265
296
|
- http://storify.com/*/*
|
266
297
|
- http://streetfire.net/video/*.htm*
|
267
298
|
- http://teachertube.com/viewVideo.php*
|
268
|
-
- http://
|
269
|
-
- http://techcrunch.tv/show/*/*
|
270
|
-
- http://techcrunch.tv/watch*
|
299
|
+
- http://telly.com/*
|
271
300
|
- http://theonion.com/video/*
|
272
301
|
- http://threadbanger.com/*/episode/*
|
273
302
|
- http://threadbanger.com/episode/*
|
@@ -302,10 +331,11 @@
|
|
302
331
|
- http://video.forbes.com/fvn/*
|
303
332
|
- http://video.google.com/videoplay?*
|
304
333
|
- http://video.jardenberg.se/*
|
305
|
-
- http://video.nationalgeographic.com
|
334
|
+
- http://video.nationalgeographic.com/video/*/*/*/*
|
306
335
|
- http://video.pbs.org/video/*
|
307
336
|
- http://video.yahoo.com/network/*
|
308
337
|
- http://video.yahoo.com/watch/*/*
|
338
|
+
- http://videodetective.com/*/*
|
309
339
|
- http://videos.nymag.com/*
|
310
340
|
- http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid*
|
311
341
|
- http://vimeo.com/*
|
@@ -313,10 +343,15 @@
|
|
313
343
|
- http://vimeo.com/m/#/*
|
314
344
|
- http://vodcars.com/*/episode/*
|
315
345
|
- http://vodcars.com/episode/*
|
346
|
+
- http://vzaar.com/videos/*
|
347
|
+
- http://vzaar.me/*
|
348
|
+
- http://vzaar.tv/*
|
316
349
|
- http://washingtonpost.com/wp-dyn/*/video/*/*/*/*
|
317
350
|
- http://wh.gov/photos-and-video/video/*
|
318
351
|
- http://wh.gov/video/*
|
352
|
+
- http://wi.st/*
|
319
353
|
- http://wirewax.com/*
|
354
|
+
- http://wistia.com/*
|
320
355
|
- http://wordpress.tv/*/*/*/*/
|
321
356
|
- http://worldstarhiphop.com/videos/video*.php?v=*
|
322
357
|
- http://www.23hq.com/*/photo/*
|
@@ -335,16 +370,17 @@
|
|
335
370
|
- http://www.barelydigital.com/episode/*
|
336
371
|
- http://www.barelypolitical.com/*/episode/*
|
337
372
|
- http://www.barelypolitical.com/episode/*
|
373
|
+
- http://www.behance.net/gallery/*
|
338
374
|
- http://www.boston.com/*video*
|
339
375
|
- http://www.boston.com/video*
|
340
376
|
- http://www.bravotv.com/*/*/videos/*
|
341
|
-
- http://www.break.com/*/*
|
342
377
|
- http://www.canalplus.fr/*
|
343
378
|
- http://www.channelfrederator.com/*/episode/*
|
344
379
|
- http://www.channelfrederator.com/episode/*
|
345
380
|
- http://www.clikthrough.com/theater/video/*
|
346
381
|
- http://www.clipfish.de/*/*/video/*
|
347
382
|
- http://www.clipshack.com/Clip.aspx?*
|
383
|
+
- http://www.clipsyndicate.com/video/playlist/*/*
|
348
384
|
- http://www.cnbc.com/id/*/play/1/video/*
|
349
385
|
- http://www.cnbc.com/id/*?*video*
|
350
386
|
- http://www.cnn.com/video/*
|
@@ -354,10 +390,14 @@
|
|
354
390
|
- http://www.collegehumor.com/video/*
|
355
391
|
- http://www.collegehumor.com/video:*
|
356
392
|
- http://www.comedycentral.com/videos/index.jhtml?*
|
393
|
+
- http://www.confreaks.com/videos/*
|
357
394
|
- http://www.confreaks.net/videos/*
|
358
395
|
- http://www.crunchbase.com/*/*
|
359
396
|
- http://www.dailymile.com/people/*/entries/*
|
360
397
|
- http://www.escapistmagazine.com/videos/*
|
398
|
+
- http://www.eyeem.com/a/*
|
399
|
+
- http://www.eyeem.com/p/*
|
400
|
+
- http://www.eyeem.com/u/*
|
361
401
|
- http://www.facebook.com/photo.php*
|
362
402
|
- http://www.facebook.com/v/*
|
363
403
|
- http://www.facebook.com/video/video.php*
|
@@ -371,15 +411,14 @@
|
|
371
411
|
- http://www.freemusicarchive.org/music/*
|
372
412
|
- http://www.funnyordie.com/m/*
|
373
413
|
- http://www.funnyordie.com/videos/*
|
374
|
-
- http://www.gametrailers.com/video
|
414
|
+
- http://www.gametrailers.com/video*
|
375
415
|
- http://www.globalpost.com/dispatch/*
|
376
416
|
- http://www.globalpost.com/video/*
|
377
417
|
- http://www.godtube.com/featured/video/*
|
378
418
|
- http://www.godtube.com/watch/*
|
379
419
|
- http://www.gogoyoko.com/song/*
|
380
|
-
- http://www.google.com/buzz/*
|
381
|
-
- http://www.google.com/buzz/*/*/*
|
382
420
|
- http://www.google.com/profiles/*
|
421
|
+
- http://www.gopollgo.com/*
|
383
422
|
- http://www.grindtv.com/*/video/*
|
384
423
|
- http://www.guardian.co.uk/*/video/*/*/*/*
|
385
424
|
- http://www.hark.com/clips/*
|
@@ -394,6 +433,8 @@
|
|
394
433
|
- http://www.ifood.tv/video/*
|
395
434
|
- http://www.indymogul.com/*/episode/*
|
396
435
|
- http://www.indymogul.com/episode/*
|
436
|
+
- http://www.jdsupra.com/legalnews/*
|
437
|
+
- http://www.khanacademy.org/*
|
397
438
|
- http://www.kickstarter.com/projects/*/*
|
398
439
|
- http://www.kiva.org/lend/*
|
399
440
|
- http://www.koldcast.tv/#video:*
|
@@ -468,6 +509,8 @@
|
|
468
509
|
- http://www.shopstyle.com/action/apiVisitRetailer*
|
469
510
|
- http://www.shopstyle.com/action/viewLook*
|
470
511
|
- http://www.shopstyle.com/browse*
|
512
|
+
- http://www.showme.com/sh/*
|
513
|
+
- http://www.sliderocket.com/*
|
471
514
|
- http://www.slideshare.net/*/*
|
472
515
|
- http://www.slideshare.net/mobile/*/*
|
473
516
|
- http://www.snotr.com/video/*
|
@@ -475,6 +518,7 @@
|
|
475
518
|
- http://www.some.ly/*
|
476
519
|
- http://www.someecards.com/*/*
|
477
520
|
- http://www.spike.com/video/*
|
521
|
+
- http://www.spreecast.com/events/*
|
478
522
|
- http://www.streetfire.net/video/*.htm*
|
479
523
|
- http://www.studivz.net/*
|
480
524
|
- http://www.studivz.net/Gadgets/Info/*
|
@@ -488,6 +532,7 @@
|
|
488
532
|
- http://www.ted.com/index.php/talks/lang/*/*.html*
|
489
533
|
- http://www.ted.com/talks/*.html*
|
490
534
|
- http://www.ted.com/talks/lang/*/*.html*
|
535
|
+
- http://www.telly.com/*
|
491
536
|
- http://www.thedailyshow.com/collection/*/*/*
|
492
537
|
- http://www.thedailyshow.com/full-episodes/*
|
493
538
|
- http://www.thedailyshow.com/watch/*
|
@@ -521,16 +566,21 @@
|
|
521
566
|
- http://www.ustream.tv/recorded/*
|
522
567
|
- http://www.vevo.com/video/*
|
523
568
|
- http://www.vevo.com/watch/*
|
569
|
+
- http://www.videodetective.com/*/*
|
570
|
+
- http://www.viewrz.com/*/event/*/*
|
571
|
+
- http://www.viewrz.com/event/*/*
|
524
572
|
- http://www.vimeo.com/*
|
525
573
|
- http://www.vimeo.com/groups/*/videos/*
|
526
574
|
- http://www.vodcars.com/*/episode/*
|
527
575
|
- http://www.vodcars.com/episode/*
|
576
|
+
- http://www.vzaar.com/videos/*
|
577
|
+
- http://www.vzaar.tv/*
|
528
578
|
- http://www.washingtonpost.com/wp-dyn/*/video/*/*/*/*
|
529
579
|
- http://www.whitehouse.gov/photos-and-video/video/*
|
530
580
|
- http://www.whitehouse.gov/video/*
|
531
|
-
- http://www.whosay.com
|
532
|
-
- http://www.whosay.com
|
533
|
-
- http://www.whosay.com
|
581
|
+
- http://www.whosay.com/*/content/*
|
582
|
+
- http://www.whosay.com/*/photos/*
|
583
|
+
- http://www.whosay.com/*/videos/*
|
534
584
|
- http://www.wikimedia.org/wiki/File*
|
535
585
|
- http://www.wikipedia.org/wiki/*
|
536
586
|
- http://www.wirewax.com/*
|
@@ -546,18 +596,23 @@
|
|
546
596
|
- http://xkcd.com/*
|
547
597
|
- http://youtu.be/*
|
548
598
|
- https://*.crocodoc.com/*
|
599
|
+
- https://*.looplogic.com/*
|
600
|
+
- https://*.wi.st/*
|
601
|
+
- https://*.wistia.com/*
|
549
602
|
- https://*.youtube.com/v/*
|
550
603
|
- https://*youtube.com/watch*
|
551
604
|
- https://app.wistia.com/embed/medias/*
|
552
605
|
- https://crocodoc.com/*
|
553
606
|
- https://foursquare.com/*
|
554
607
|
- https://ganxy.com/*
|
608
|
+
- https://gist.github.com/*
|
555
609
|
- https://img.skitch.com/*
|
556
610
|
- https://itunes.apple.com/*
|
557
611
|
- https://mobile.twitter.com/*/status/*
|
558
612
|
- https://mobile.twitter.com/*/status/*/photo/*
|
559
613
|
- https://mobile.twitter.com/*/statuses/*
|
560
614
|
- https://mobile.twitter.com/*/statuses/*/photo/*
|
615
|
+
- https://plus.google.com/*
|
561
616
|
- https://skitch.com/*/*/*
|
562
617
|
- https://twitter.com/*/status/*
|
563
618
|
- https://twitter.com/*/status/*/photo/*
|
@@ -565,6 +620,9 @@
|
|
565
620
|
- https://twitter.com/*/statuses/*/photo/*
|
566
621
|
- https://urtak.com/clr/*
|
567
622
|
- https://urtak.com/u/*
|
623
|
+
- https://vimeo.com/*
|
624
|
+
- https://wi.st/*
|
625
|
+
- https://wistia.com/*
|
568
626
|
- https://www.facebook.com/photo.php*
|
569
627
|
- https://www.facebook.com/v/*
|
570
628
|
- https://www.facebook.com/video/video.php*
|
@@ -574,3 +632,4 @@
|
|
574
632
|
- https://www.twitter.com/*/status/*/photo/*
|
575
633
|
- https://www.twitter.com/*/statuses/*
|
576
634
|
- https://www.twitter.com/*/statuses/*/photo/*
|
635
|
+
- https://www.vimeo.com/*
|
data/lib/oembed/providers.rb
CHANGED
@@ -43,7 +43,7 @@ module OEmbed
|
|
43
43
|
|
44
44
|
# Register all Providers built into this gem.
|
45
45
|
# The including_sub_type parameter should be one of the following values:
|
46
|
-
# * :aggregators: also register provider
|
46
|
+
# * :aggregators: also register provider aggregator endpoints, like Embedly
|
47
47
|
def register_all(*including_sub_type)
|
48
48
|
register(*@@to_register[""])
|
49
49
|
including_sub_type.each do |sub_type|
|
@@ -128,8 +128,14 @@ module OEmbed
|
|
128
128
|
|
129
129
|
# Provider for youtube.com
|
130
130
|
# http://apiblog.youtube.com/2009/10/oembed-support.html
|
131
|
-
#
|
132
|
-
# :
|
131
|
+
#
|
132
|
+
# Options:
|
133
|
+
# * To get the iframe embed code
|
134
|
+
# OEmbed::Providers::Youtube.endpoint += "?iframe=1"
|
135
|
+
# * To get the flash/object embed code
|
136
|
+
# OEmbed::Providers::Youtube.endpoint += "?iframe=0"
|
137
|
+
# * To require https embed code
|
138
|
+
# OEmbed::Providers::Youtube.endpoint += "?scheme=https"
|
133
139
|
Youtube = OEmbed::Provider.new("http://www.youtube.com/oembed")
|
134
140
|
Youtube << "http://*.youtube.com/*"
|
135
141
|
Youtube << "https://*.youtube.com/*"
|
@@ -167,8 +173,8 @@ module OEmbed
|
|
167
173
|
add_official_provider(Hulu)
|
168
174
|
|
169
175
|
# Provider for vimeo.com
|
170
|
-
# http://vimeo.com/
|
171
|
-
Vimeo = OEmbed::Provider.new("http://
|
176
|
+
# http://developer.vimeo.com/apis/oembed
|
177
|
+
Vimeo = OEmbed::Provider.new("http://vimeo.com/api/oembed.{format}")
|
172
178
|
Vimeo << "http://*.vimeo.com/*"
|
173
179
|
Vimeo << "https://*.vimeo.com/*"
|
174
180
|
add_official_provider(Vimeo)
|
@@ -249,6 +255,13 @@ module OEmbed
|
|
249
255
|
SoundCloud << "http://*.soundcloud.com/*"
|
250
256
|
add_official_provider(SoundCloud)
|
251
257
|
|
258
|
+
# Provider for skitch.com
|
259
|
+
# http://skitch.com/oembed/%3C/endpoint
|
260
|
+
Skitch = OEmbed::Provider.new("http://skitch.com/oembed")
|
261
|
+
Skitch << "http://*.skitch.com/*"
|
262
|
+
Skitch << "https://*.skitch.com/*"
|
263
|
+
add_official_provider(Skitch)
|
264
|
+
|
252
265
|
## Provider for clikthrough.com
|
253
266
|
# http://corporate.clikthrough.com/wp/?p=275
|
254
267
|
#Clickthrough = OEmbed::Provider.new("http://www.clikthrough.com/services/oembed/")
|
@@ -261,7 +274,7 @@ module OEmbed
|
|
261
274
|
#Kinomap << "http://www.kinomap.com/*"
|
262
275
|
#add_official_provider(Kinomap)
|
263
276
|
|
264
|
-
# Provider for oohembed.com, which is a provider
|
277
|
+
# Provider for oohembed.com, which is a provider aggregator. See
|
265
278
|
# OEmbed::Providers::OohEmbed.urls for a full list of supported url schemas.
|
266
279
|
# Embed.ly has taken over the oohembed.com domain and as of July 20 all oohEmbed
|
267
280
|
# request will require you use an API key. For details on the transition see
|
@@ -301,11 +314,14 @@ module OEmbed
|
|
301
314
|
OohEmbed << %r{http://yfrog.(com|ru|com.tr|it|fr|co.il|co.uk|com.pl|pl|eu|us)/(.*?)} # image & video hosting
|
302
315
|
OohEmbed << "http://*.youtube.com/watch*"
|
303
316
|
|
304
|
-
# Provider for Embedly.com, which is a provider
|
317
|
+
# Provider for Embedly.com, which is a provider aggregator. See
|
305
318
|
# OEmbed::Providers::Embedly.urls for a full list of supported url schemas.
|
306
319
|
# http://embed.ly/docs/endpoints/1/oembed
|
307
|
-
#
|
308
|
-
#
|
320
|
+
#
|
321
|
+
# You can append your Embed.ly API key to the provider so that all requests are signed
|
322
|
+
# OEmbed::Providers::Embedly.endpoint += "?key=#{my_embedly_key}"
|
323
|
+
#
|
324
|
+
# If you don't yet have an API key you'll need to sign up here: http://embed.ly/pricing
|
309
325
|
Embedly = OEmbed::Provider.new("http://api.embed.ly/1/oembed")
|
310
326
|
# Add all known URL regexps for Embedly. To update this list run `rake oembed:update_embedly`
|
311
327
|
YAML.load_file(File.join(File.dirname(__FILE__), "/providers/embedly_urls.yml")).each do |url|
|
@@ -4,7 +4,7 @@ module OEmbed
|
|
4
4
|
class Photo < self
|
5
5
|
# Returns an <img> tag pointing at the appropraite URL.
|
6
6
|
def html
|
7
|
-
"<img src='
|
7
|
+
"<img src='#{self.url}' alt='#{(self.respond_to?(:title) ? self.title : nil)}' />"
|
8
8
|
end
|
9
9
|
|
10
10
|
private
|
@@ -18,4 +18,4 @@ module OEmbed
|
|
18
18
|
|
19
19
|
end
|
20
20
|
end
|
21
|
-
end
|
21
|
+
end
|
data/lib/oembed/version.rb
CHANGED
data/lib/tasks/oembed.rake
CHANGED
data/ruby-oembed.gemspec
CHANGED
@@ -1,88 +1,36 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
1
|
# -*- encoding: utf-8 -*-
|
5
2
|
|
3
|
+
lib = File.expand_path('../lib/', __FILE__)
|
4
|
+
$:.unshift lib unless $:.include?(lib)
|
5
|
+
|
6
|
+
require 'oembed/version'
|
7
|
+
|
6
8
|
Gem::Specification.new do |s|
|
7
9
|
s.name = "ruby-oembed"
|
8
|
-
s.version =
|
10
|
+
s.version = OEmbed::Version.to_s
|
9
11
|
|
10
12
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
13
|
s.authors = ["Magnus Holm", "Alex Kessinger", "Aris Bartee", "Marcos Wright Kuhns"]
|
12
|
-
s.date = "2012-
|
14
|
+
s.date = "2012-11-19"
|
13
15
|
s.description = "An oEmbed consumer library written in Ruby, letting you easily get embeddable HTML representations of supported web pages, based on their URLs. See http://oembed.com for more information about the protocol."
|
14
16
|
s.email = "arisbartee@gmail.com"
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE",
|
17
|
-
"README.rdoc"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".rvmrc",
|
21
|
-
".travis.yml",
|
22
|
-
".yardopts",
|
23
|
-
"CHANGELOG.rdoc",
|
24
|
-
"Gemfile",
|
25
|
-
"Gemfile.lock",
|
26
|
-
"LICENSE",
|
27
|
-
"README.rdoc",
|
28
|
-
"Rakefile",
|
29
|
-
"integration_test/test.rb",
|
30
|
-
"integration_test/test_urls.csv",
|
31
|
-
"lib/oembed.rb",
|
32
|
-
"lib/oembed/errors.rb",
|
33
|
-
"lib/oembed/formatter.rb",
|
34
|
-
"lib/oembed/formatter/base.rb",
|
35
|
-
"lib/oembed/formatter/json.rb",
|
36
|
-
"lib/oembed/formatter/json/backends/activesupportjson.rb",
|
37
|
-
"lib/oembed/formatter/json/backends/jsongem.rb",
|
38
|
-
"lib/oembed/formatter/json/backends/yaml.rb",
|
39
|
-
"lib/oembed/formatter/xml.rb",
|
40
|
-
"lib/oembed/formatter/xml/backends/nokogiri.rb",
|
41
|
-
"lib/oembed/formatter/xml/backends/rexml.rb",
|
42
|
-
"lib/oembed/formatter/xml/backends/xmlsimple.rb",
|
43
|
-
"lib/oembed/provider.rb",
|
44
|
-
"lib/oembed/provider_discovery.rb",
|
45
|
-
"lib/oembed/providers.rb",
|
46
|
-
"lib/oembed/providers/embedly_urls.yml",
|
47
|
-
"lib/oembed/providers/oohembed_urls.yml",
|
48
|
-
"lib/oembed/response.rb",
|
49
|
-
"lib/oembed/response/link.rb",
|
50
|
-
"lib/oembed/response/photo.rb",
|
51
|
-
"lib/oembed/response/rich.rb",
|
52
|
-
"lib/oembed/response/video.rb",
|
53
|
-
"lib/oembed/version.rb",
|
54
|
-
"lib/tasks/oembed.rake",
|
55
|
-
"lib/tasks/rspec.rake",
|
56
|
-
"ruby-oembed.gemspec",
|
57
|
-
"spec/cassettes/OEmbed_Provider.yml",
|
58
|
-
"spec/cassettes/OEmbed_ProviderDiscovery.yml",
|
59
|
-
"spec/formatter/ducktype_backend_spec.rb",
|
60
|
-
"spec/formatter/json/.DS_Store",
|
61
|
-
"spec/formatter/json/jsongem_backend_spec.rb",
|
62
|
-
"spec/formatter/json/yaml_backend_spec.rb",
|
63
|
-
"spec/formatter/xml/nokogiri_backend_spec.rb",
|
64
|
-
"spec/formatter/xml/rexml_backend_spec.rb",
|
65
|
-
"spec/formatter/xml/xmlsimple_backend_spec.rb",
|
66
|
-
"spec/formatter_spec.rb",
|
67
|
-
"spec/provider_discovery_spec.rb",
|
68
|
-
"spec/provider_spec.rb",
|
69
|
-
"spec/providers_spec.rb",
|
70
|
-
"spec/response_spec.rb",
|
71
|
-
"spec/spec_helper.rb",
|
72
|
-
"spec/spec_helper_examples.yml"
|
73
|
-
]
|
74
17
|
s.homepage = "http://github.com/judofyr/ruby-oembed"
|
75
18
|
s.licenses = ["MIT"]
|
76
|
-
|
19
|
+
|
20
|
+
s.files = `git ls-files`.split("\n")
|
21
|
+
s.test_files = s.files.grep(%r{^(test|spec|features,integration_test)/})
|
22
|
+
|
23
|
+
s.rdoc_options = ["--main", "README.rdoc", "--title", "ruby-oembed-#{OEmbed::Version}", "--inline-source", "--exclude", "tasks", "CHANGELOG.rdoc"]
|
24
|
+
s.extra_rdoc_files = s.files.grep(%r{\.rdoc$}) + %w{LICENSE}
|
25
|
+
|
77
26
|
s.require_paths = ["lib"]
|
78
|
-
s.rubygems_version = "1.8.
|
27
|
+
s.rubygems_version = "1.8.19"
|
79
28
|
s.summary = "oEmbed for Ruby"
|
80
29
|
|
81
30
|
if s.respond_to? :specification_version then
|
82
31
|
s.specification_version = 3
|
83
32
|
|
84
33
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
85
|
-
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
86
34
|
s.add_development_dependency(%q<rake>, [">= 0"])
|
87
35
|
s.add_development_dependency(%q<json>, [">= 0"])
|
88
36
|
s.add_development_dependency(%q<xml-simple>, [">= 0"])
|
@@ -91,7 +39,6 @@ Gem::Specification.new do |s|
|
|
91
39
|
s.add_development_dependency(%q<vcr>, ["~> 1.0"])
|
92
40
|
s.add_development_dependency(%q<fakeweb>, [">= 0"])
|
93
41
|
else
|
94
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
95
42
|
s.add_dependency(%q<rake>, [">= 0"])
|
96
43
|
s.add_dependency(%q<json>, [">= 0"])
|
97
44
|
s.add_dependency(%q<xml-simple>, [">= 0"])
|
@@ -101,7 +48,6 @@ Gem::Specification.new do |s|
|
|
101
48
|
s.add_dependency(%q<fakeweb>, [">= 0"])
|
102
49
|
end
|
103
50
|
else
|
104
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
105
51
|
s.add_dependency(%q<rake>, [">= 0"])
|
106
52
|
s.add_dependency(%q<json>, [">= 0"])
|
107
53
|
s.add_dependency(%q<xml-simple>, [">= 0"])
|