oembedr 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ oembedr_gem
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-1.9.3-p448
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # CHANGELOG
2
+
3
+ ## 1.0.0 (2012-07-24)
4
+
5
+ * Fix Oembed endpoint for Vimeo.
6
+ * Adds Soundcloud Oembed endpoint.
7
+
1
8
  ## 0.0.3 (2012-01-19)
2
9
 
3
10
  * fix typo; add more providers.
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in oembedr.gemspec
4
4
  gemspec
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Matthew Wilson
1
+ Copyright (c) 2012-2013 Matthew Wilson
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -70,4 +70,4 @@ A big thanks to everyone who [contributes](https://github.com/agoragames/oembedr
70
70
 
71
71
  ## Copyright
72
72
 
73
- Copyright (c) 2012 Matthew Wilson. MIT-license: see LICENSE.txt for further details.
73
+ Copyright (c) 2012-2013 Matthew Wilson. MIT-license: see LICENSE.txt for further details.
@@ -3,31 +3,59 @@ module Oembedr
3
3
 
4
4
  # from ruby-oembed with a couple more I know of from user feedback :).
5
5
  LIST = {
6
+ # Video
6
7
  /(youtu\.be|youtube)/ => "http://www.youtube.com/oembed",
7
- /(flic\.kr|flickr)/ => "http://www.flickr.com/services/oembed/",
8
- /viddler/ => "http://lab.viddler.com/services/oembed/",
8
+ /viddler/ => "http://www.viddler.com/oembed/",
9
9
  /qik/ => "http://qik.com/api/oembed.{format}",
10
10
  /revision3/ => "http://revision3.com/api/oembed/",
11
11
  /hulu/ => "http://www.hulu.com/api/oembed.{format}",
12
- /vimeo/ => "http://www.vimeo.com/api/oembed.{format}",
13
- /instagr.am/ => "http://api.instagram.com/oembed",
14
- /slideshare/ => "http://www.slideshare.net/api/oembed/2",
12
+ /vimeo/ => "http://vimeo.com/api/oembed.{format}",
15
13
  /(mlg\.tv|tv\.majorleaguegaming)/ => "http://tv.majorleaguegaming.com/oembed",
14
+ /twitch\.tv/ => 'http://api.twitch.tv/api/embed/',
15
+ /dailymotion\.com/ => 'http://www.dailymotion.com/api/oembed/',
16
+ /dotsub\.com/ => 'http://dotsub.com/services/oembed',
17
+ /clikthrough\.com/ => 'http://clikthrough.com/services/oembed',
18
+ /movieclips\.com/ => 'http://movieclips.com/services/oembed/',
19
+ /ustream\.tv/ => 'http://www.ustream.tv/oembed',
20
+ /blip\.tv/ => 'http://blip.tv/oembed',
21
+ /nfb\.ca/ => 'http://www.nfb.ca/remote/services/oembed/',
22
+ /bambuser\.com/ => 'http://api.bambuser.com/oembed/iframe.{format}',
23
+ /justin\.tv/ => 'http://api.justin.tv/api/embed/from_url.{format}',
24
+ /wordpress\.tv/ => 'http://wordpress.tv/oembed/',
25
+ /collegehumor\.com/ => 'http://www.collegehumor.com/oembed.{format}',
26
+
27
+ # Audio
28
+ /soundcloud\.com/ => 'http://soundcloud.com/oembed',
29
+ /open\.spotify\.com/ => 'https://embed.spotify.com/oembed/',
30
+ /(rdio\.com|rd\.io)/ => 'http://www.rdio.com/api/oembed/',
31
+
32
+ # Image
33
+ /(deviantart\.com|fav\.me)/ => 'http://backend.deviantart.com/oembed',
34
+ /(flic\.kr|flickr)/ => "http://www.flickr.com/services/oembed/",
35
+ /(instagr\.am|instagram\.com)/ => "http://api.instagram.com/oembed",
16
36
  /yfrog/ => "http://www.yfrog.com/api/oembed",
17
- /blip\.tv/ => "http://blip.tv/oembed/",
18
- /opera\.com/ => 'http://my.opera.com/service/oembed',
19
37
  /skitch\.com/ => 'http://skitch.com/oembed',
20
- /twitch\.tv/ => false, # OMG! Support OEmbed!
38
+ /photobucket\.com/ => 'http://photobucket.com/oembed',
39
+
40
+ # Rich
41
+ /slideshare/ => "http://www.slideshare.net/api/oembed/2",
21
42
  /twitter\.com/ => 'https://api.twitter.com/1/statuses/oembed.{format}',
22
- /dailymotion\.com/ => 'http://www.dailymotion.com/api/oembed/',
23
43
  /scribd\.com/ => 'http://www.scribd.com/services/oembed',
24
- /dotsub\.com/ => 'http://dotsub.com/services/oembed',
25
- /clikthrough\.com/ => 'http://clikthrough.com/services/oembed',
26
44
  /kinomap\.com/ => 'http://www.kinomap.com/oembed',
27
- /photobucket\.com/ => 'http://photobucket.com/oembed',
28
45
  /speakerdeck\.com/ => 'https://speakerdeck.com/oembed.{format}',
29
- /soundcloud\.com/ => 'http://soundcloud.com/oembed'
30
- # ...
46
+ /polldaddy\.com/ => 'http://polldaddy.com/oembed/',
47
+ /polleverywhere\.com/ => 'http://www.polleverywhere.com/services/oembed/',
48
+ /gmep\.org/ => 'https://gmep.org/oembed.{format}',
49
+ /cacoo\.com/ => 'http://cacoo.com/oembed.{format}',
50
+ /dailymile\.com/ => 'http://api.dailymile.com/oembed',
51
+ /dipity\.com/ => 'http://www.dipity.com/oembed/timeline/',
52
+ /sketchfab\.com\/show/ => 'http://sketchfab.com/oembed',
53
+ /ifixit\.com/ => 'http://www.ifixit.com/Embed',
54
+ /(wordpress\.com|blogs\.cnn\.com|techcrunch\.com|wp\.me)/ =>
55
+ 'http://public-api.wordpress.com/oembed/1.0/',
56
+
57
+ # NoEmbed
58
+ /(thedailyshow\.com|funnyordie\.com|ted\.com|livejournal\.com|github\.com|metacafe\.com|wikipedia\.org|xkcd\.com|imdb\.com)/ => 'http://noembed.com/embed?nowrap=on'
31
59
  }
32
60
 
33
61
  # Locate the correct service endpoint for the given resource URL.
@@ -52,4 +80,4 @@ module Oembedr
52
80
  end
53
81
 
54
82
  end
55
- end
83
+ end
@@ -1,3 +1,3 @@
1
1
  module Oembedr
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
data/oembedr.gemspec CHANGED
@@ -10,6 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.homepage = "https://github.com/agoragames/oembedr"
11
11
  s.summary = %q{Lightweight, Flexible OEmbed Consumer Library}
12
12
  s.description = %q{oembedr aims to make consuming oembed resources easy}
13
+ s.license = 'MIT'
13
14
 
14
15
  # s.rubyforge_project = "oembedr"
15
16
 
@@ -4,57 +4,79 @@ module Oembedr
4
4
  describe Providers do
5
5
 
6
6
  describe "#service_endpoint" do
7
- it "matches the given URL to a known endpoint" do
8
- endpoint = Oembedr.service_endpoint("http://www.youtube.com/watch?v=b9XsTtFu64Y")
9
- endpoint.should_not be_false
7
+ let(:test_url) { 'http://www.youtube.com/watch?v=b9XsTtFu64Y' }
8
+
9
+ subject do
10
+ Oembedr.service_endpoint(test_url)
10
11
  end
11
- it "returns false if there is no known endpoint" do
12
- Oembedr.service_endpoint("http://www.madeupdomainthatwedontsupportyet.com/foos/324").should be_false
12
+
13
+ it { should_not be_empty }
14
+
15
+ context 'with an invalid url' do
16
+ let(:test_url) { 'http://www.madeupdomainthatwedontsupportyet.com/foos/324' }
17
+
18
+ it { should be_false }
13
19
  end
14
20
  end
15
21
 
16
22
  describe "#known_service?" do
17
- it "should return a boolean yes or no if we can handle the given url" do
18
- Oembedr.known_service?("http://www.youtube.com/watch?v=b9XsTtFu64Y").should be_true
19
- Oembedr.known_service?("http://www.noserviceherenosir.com/foos/324").should be_false
20
- end
21
- end
23
+ let(:test_url) {}
22
24
 
23
- context "testing ALL THE THINGS" do
24
- {
25
- "http://www.youtube.com/watch?v=b9XsTtFu64Y" => "http://www.youtube.com/oembed",
26
- "http://youtu.be/b9XsTtFu64Y" => "http://www.youtube.com/oembed",
27
- "http://www.flickr.com/photos/puzzlemaster/6693154925/in/photostream" => "http://www.flickr.com/services/oembed/",
28
- "http://www.flic.kr/6693154925" => "http://www.flickr.com/services/oembed/",
29
- "http://www.viddler.com/v/a802f490" => "http://lab.viddler.com/services/oembed/",
30
- "http://qik.com/video/15944" => "http://qik.com/api/oembed.{format}",
31
- "http://revision3.com/tbhs/holidaycontroller" => "http://revision3.com/api/oembed/",
32
- "http://www.hulu.com/watch/319756/the-daily-show-with-jon-stewart-mon-jan-16-2012" => "http://www.hulu.com/api/oembed.{format}",
33
- "http://vimeo.com/35055590" => "http://www.vimeo.com/api/oembed.{format}",
34
- "http://instagr.am/p/BUG/" => "http://api.instagram.com/oembed",
35
- "http://www.slideshare.net/alwynlau/martin-luther-king-jr-quote-presentation" => "http://www.slideshare.net/api/oembed/2",
36
- "http://tv.majorleaguegaming.com/videos/80344-the-year-in-starcraft-2" => "http://tv.majorleaguegaming.com/oembed",
37
- "http://yfrog.com/hsyu9ymj" => "http://www.yfrog.com/api/oembed",
38
- "http://blip.tv/cablekooks/fox-news-anchor-john-stossel-wants-people-to-stop-voting-5883656" => "http://blip.tv/oembed/",
39
- "http://opera.com" => 'http://my.opera.com/service/oembed',
40
- "http://skitch.com/hannaolsen/rq33h/vday" => 'http://skitch.com/oembed',
41
- "http://www.twitch.tv/i_like_turtlez" => false, # OMG! Support OEmbed!
42
- "https://twitter.com/hypomodern/status/158203918323695616" => 'https://api.twitter.com/1/statuses/oembed.{format}',
43
- "http://www.dailymotion.com/video/x5ioet_phoenix-mars-lander_tech" => 'http://www.dailymotion.com/api/oembed/',
44
- "http://www.scribd.com/doc/17896323/Indian-Automobile-industryPEST" => 'http://www.scribd.com/services/oembed',
45
- "http://dotsub.com/view/10e3cb5e-96c7-4cfb-bcea-8ab11e04e090" => 'http://dotsub.com/services/oembed',
46
- "http://www.clikthrough.com/theater/video/55" => 'http://clikthrough.com/services/oembed',
47
- "http://www.kinomap.com/kms-vzkpc7" => 'http://www.kinomap.com/oembed',
48
- "http://img.photobucket.com/albums/v211/JAV123/Michael%20Holland%20Candle%20Burning/_MG_5661.jpg" => 'http://photobucket.com/oembed',
49
- "https://speakerdeck.com/u/czarneckid/p/railsconf-2012-stack-smashing-cornflower-blue" => 'https://speakerdeck.com/oembed.{format}',
50
- "http://soundcloud.com/cape910/17-cape-x-example-midnight-run" => 'http://soundcloud.com/oembed'
51
- }.each do |(test_url, expected_value)|
52
- it "should match #{test_url} to #{expected_value}" do
53
- Oembedr.service_endpoint(test_url).should == expected_value
54
- end
25
+ subject { Oembedr.known_service?(test_url).should be_true }
55
26
 
27
+ %w(
28
+ http://www.youtube.com/watch?v=b9XsTtFu64Y
29
+ http://youtu.be/b9XsTtFu64Y
30
+ http://www.flickr.com/photos/puzzlemaster/6693154925/in/photostream
31
+ http://www.flic.kr/6693154925
32
+ http://www.viddler.com/v/a802f490
33
+ http://qik.com/video/15944
34
+ http://revision3.com/tbhs/holidaycontroller
35
+ http://www.hulu.com/watch/319756/the-daily-show-with-jon-stewart-mon-jan-16-2012
36
+ http://vimeo.com/35055590
37
+ http://instagr.am/p/BUG/
38
+ http://www.slideshare.net/alwynlau/martin-luther-king-jr-quote-presentation
39
+ http://tv.majorleaguegaming.com/videos/80344-the-year-in-starcraft-2
40
+ http://yfrog.com/hsyu9ymj
41
+ http://blip.tv/cablekooks/fox-news-anchor-john-stossel-wants-people-to-stop-voting-5883656
42
+ http://skitch.com/hannaolsen/rq33h/vday
43
+ http://www.twitch.tv/esltv_lol/c/2637023
44
+ https://twitter.com/hypomodern/status/158203918323695616
45
+ http://www.dailymotion.com/video/x5ioet_phoenix-mars-lander_tech
46
+ http://www.scribd.com/doc/17896323/Indian-Automobile-industryPEST
47
+ http://dotsub.com/view/10e3cb5e-96c7-4cfb-bcea-8ab11e04e090
48
+ http://www.clikthrough.com/theater/video/55
49
+ http://www.kinomap.com/kms-vzkpc7
50
+ http://img.photobucket.com/albums/v211/JAV123/Michael%20Holland%20Candle%20Burning/_MG_5661.jpg
51
+ https://speakerdeck.com/u/czarneckid/p/railsconf-2012-stack-smashing-cornflower-blue
52
+ http://soundcloud.com/cape910/17-cape-x-example-midnight-run
53
+ http://www.ustream.tv/recorded/36626129
54
+ http://www.nfb.ca/film/judoka?hpen=feature_1
55
+ http://bambuser.com/v/2279611
56
+ http://www.justin.tv/wagntail/b/438417161
57
+ http://wordpress.tv/2013/07/29/matt-mullenweg-state-of-the-word-2013/
58
+ http://www.collegehumor.com/video/6905412/how-hollywood-ruins-relationships-with-kristen-connolly
59
+ http://open.spotify.com/track/07FjCnZHF4XpHyMMFS20rl
60
+ http://en.wikipedia.org/wiki/Perl_6_rules#Grammars
61
+ https://gist.github.com/leedo/796300
62
+ https://github.com/leedo/noembed/commit/87fc1b3a439d9ccd724b331e32223cad289eb6a1
63
+ https://speakerdeck.com/stas/on-saltstack-configuration-management-and-remote-execution
64
+ http://polldaddy.com/poll/7012505/
65
+ https://gmep.org/media/14684
66
+ https://cacoo.com/diagrams/pByowlpiZ7YTV7UN
67
+ http://www.dailymile.com/people/delsolman1/entries/24232560
68
+ http://www.dipity.com/tatercakes/Internet_Memes/
69
+ http://sketchfab.com/show/ddf560de3fd34a019a201937219298ff
70
+ http://www.ifixit.com/Guide/Installing+MacBook+Pro+13-Inch+Unibody+Mid+2009+Display/1342/1
71
+ http://techcrunch.com/2013/07/31/sign-up-for-the-berlin-pitch-off-now/
72
+ ).each_with_index do |url, ind|
73
+ context "for #{url}, tests: #{ind}/#{Oembedr::Providers::LIST.count}" do
74
+ let(:test_url) { url }
75
+
76
+ it { should be_true }
77
+ end
56
78
  end
57
79
  end
58
80
 
59
81
  end
60
- end
82
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oembedr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-24 00:00:00.000000000 Z
12
+ date: 2013-08-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -196,7 +196,8 @@ extra_rdoc_files: []
196
196
  files:
197
197
  - .gitignore
198
198
  - .rspec
199
- - .rvmrc
199
+ - .ruby-gemset
200
+ - .ruby-version
200
201
  - .travis.yml
201
202
  - CHANGELOG.md
202
203
  - Gemfile
@@ -218,7 +219,8 @@ files:
218
219
  - spec/oembedr_spec.rb
219
220
  - spec/spec_helper.rb
220
221
  homepage: https://github.com/agoragames/oembedr
221
- licenses: []
222
+ licenses:
223
+ - MIT
222
224
  post_install_message:
223
225
  rdoc_options: []
224
226
  require_paths:
@@ -229,15 +231,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
229
231
  - - ! '>='
230
232
  - !ruby/object:Gem::Version
231
233
  version: '0'
234
+ segments:
235
+ - 0
236
+ hash: -348172818553904717
232
237
  required_rubygems_version: !ruby/object:Gem::Requirement
233
238
  none: false
234
239
  requirements:
235
240
  - - ! '>='
236
241
  - !ruby/object:Gem::Version
237
242
  version: '0'
243
+ segments:
244
+ - 0
245
+ hash: -348172818553904717
238
246
  requirements: []
239
247
  rubyforge_project:
240
- rubygems_version: 1.8.24
248
+ rubygems_version: 1.8.25
241
249
  signing_key:
242
250
  specification_version: 3
243
251
  summary: Lightweight, Flexible OEmbed Consumer Library
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm use --create 1.9.3@oembedr_gem