Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding more OEmbed providers #1

Merged
merged 1 commit into from
Jan 19, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/oembedr/providers.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ module Providers
/skitch\.com/ => 'http://skitch.com/oembed', /skitch\.com/ => 'http://skitch.com/oembed',
/twitch\.tv/ => false, # OMG! Support OEmbed! /twitch\.tv/ => false, # OMG! Support OEmbed!
/twitter\.com/ => 'https://api.twitter.com/1/statuses/oembed.{format}', /twitter\.com/ => 'https://api.twitter.com/1/statuses/oembed.{format}',
/dailymotion\.com/ => 'http://www.dailymotion.com/api/oembed/',
/scribd\.com/ => 'http://www.scribd.com/services/oembed',
/dotsub\.com/ => 'http://dotsub.com/services/oembed',
/clikthrough\.com/ => 'http://clikthrough.com/services/oembed',
/kinomap\.com/ => 'http://www.kinomap.com/oembed',
/photobucket\.com/ => 'http://photobucket.com/oembed'
# ... # ...
} }


Expand Down
8 changes: 7 additions & 1 deletion spec/oembedr/providers_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ module Oembedr
"http://opera.com" => 'http://my.opera.com/service/oembed', "http://opera.com" => 'http://my.opera.com/service/oembed',
"http://skitch.com/hannaolsen/rq33h/vday" => 'http://skitch.com/oembed', "http://skitch.com/hannaolsen/rq33h/vday" => 'http://skitch.com/oembed',
"http://www.twitch.tv/i_like_turtlez" => false, # OMG! Support OEmbed! "http://www.twitch.tv/i_like_turtlez" => false, # OMG! Support OEmbed!
"https://twitter.com/hypomodern/status/158203918323695616" => 'https://api.twitter.com/1/statuses/oembed.{format}' "https://twitter.com/hypomodern/status/158203918323695616" => 'https://api.twitter.com/1/statuses/oembed.{format}',
"http://www.dailymotion.com/video/x5ioet_phoenix-mars-lander_tech" => 'http://www.dailymotion.com/api/oembed/',
"http://www.scribd.com/doc/17896323/Indian-Automobile-industryPEST" => 'http://www.scribd.com/services/oembed',
"http://dotsub.com/view/10e3cb5e-96c7-4cfb-bcea-8ab11e04e090" => 'http://dotsub.com/services/oembed',
"http://www.clikthrough.com/theater/video/55" => 'http://clikthrough.com/services/oembed',
"http://www.kinomap.com/kms-vzkpc7" => 'http://www.kinomap.com/oembed',
"http://img.photobucket.com/albums/v211/JAV123/Michael%20Holland%20Candle%20Burning/_MG_5661.jpg" => 'http://photobucket.com/oembed'
}.each do |(test_url, expected_value)| }.each do |(test_url, expected_value)|
it "should match #{test_url} to #{expected_value}" do it "should match #{test_url} to #{expected_value}" do
Oembedr.service_endpoint(test_url).should == expected_value Oembedr.service_endpoint(test_url).should == expected_value
Expand Down