Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Break all built-in OEmbed::Providers into separate files
This makes rubocop more happy *and* actually makes organization a bit simpler. This commit is expected to be broken.
- Loading branch information
Showing
31 changed files
with
284 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module OEmbed | ||
class Providers | ||
# Provider for Embedly.com, which is a provider aggregator. See | ||
# OEmbed::Providers::Embedly.urls for a full list of supported url schemas. | ||
# http://embed.ly/docs/endpoints/1/oembed | ||
# | ||
# You can append your Embed.ly API key to the provider so that all requests are signed | ||
# OEmbed::Providers::Embedly.endpoint += "?key=#{my_embedly_key}" | ||
# | ||
# If you don't yet have an API key you'll need to sign up here: http://embed.ly/pricing | ||
Embedly = OEmbed::Provider.new('http://api.embed.ly/1/oembed') | ||
# Add all known URL regexps for Embedly. To update this list run `rake oembed:update_embedly` | ||
YAML.load_file(File.join(File.dirname(__FILE__), '/embedly_urls.yml')).each do |url| | ||
Embedly << url | ||
end | ||
add_official_provider(Embedly, :aggregators) | ||
end | ||
end |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module OEmbed | ||
class Providers | ||
# Providers for Facebook Posts & Videos | ||
# https://developers.facebook.com/docs/plugins/oembed-endpoints | ||
FacebookPost = OEmbed::Provider.new('https://www.facebook.com/plugins/post/oembed.json/', :json) | ||
FacebookPost << 'https://www.facebook.com/*/posts/*' | ||
FacebookPost << 'https://www.facebook.com/*/activity/*' | ||
FacebookPost << 'https://www.facebook.com/photo*' | ||
FacebookPost << 'https://www.facebook.com/photos*' | ||
FacebookPost << 'https://www.facebook.com/*/photos*' | ||
FacebookPost << 'https://www.facebook.com/permalink*' | ||
FacebookPost << 'https://www.facebook.com/media*' | ||
FacebookPost << 'https://www.facebook.com/questions*' | ||
FacebookPost << 'https://www.facebook.com/notes*' | ||
add_official_provider(FacebookPost) | ||
|
||
FacebookVideo = OEmbed::Provider.new('https://www.facebook.com/plugins/video/oembed.json/', :json) | ||
FacebookVideo << 'https://www.facebook.com/*/videos/*' | ||
FacebookVideo << 'https://www.facebook.com/video*' | ||
add_official_provider(FacebookVideo) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module OEmbed | ||
class Providers | ||
# Provider for flickr.com | ||
Flickr = OEmbed::Provider.new('https://www.flickr.com/services/oembed/') | ||
Flickr << 'http://*.flickr.com/*' | ||
Flickr << 'https://*.flickr.com/*' | ||
Flickr << 'http://flic.kr/*' | ||
Flickr << 'https://flic.kr/*' | ||
add_official_provider(Flickr) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module OEmbed | ||
class Providers | ||
# Provider for hulu.com | ||
Hulu = OEmbed::Provider.new('http://www.hulu.com/api/oembed.{format}') | ||
Hulu << 'http://www.hulu.com/watch/*' | ||
add_official_provider(Hulu) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module OEmbed | ||
class Providers | ||
# Provider for imgur.com | ||
Imgur = OEmbed::Provider.new('https://api.imgur.com/oembed.{format}') | ||
Imgur << 'https://*.imgur.com/gallery/*' | ||
Imgur << 'http://*.imgur.com/gallery/*' | ||
add_official_provider(Imgur) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module OEmbed | ||
class Providers | ||
# Provider for instagram.com | ||
# https://instagr.am/developer/embedding/ | ||
Instagram = OEmbed::Provider.new('https://api.instagram.com/oembed', :json) | ||
Instagram << 'http://instagr.am/p/*' | ||
Instagram << 'http://instagram.com/p/*' | ||
Instagram << 'http://www.instagram.com/p/*' | ||
Instagram << 'https://instagr.am/p/*' | ||
Instagram << 'https://instagram.com/p/*' | ||
Instagram << 'https://www.instagram.com/p/*' | ||
add_official_provider(Instagram) | ||
end | ||
end |
Oops, something went wrong.