ruby-oembed 0.8.10 → 0.8.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/CHANGELOG.rdoc +5 -0
- data/lib/oembed/provider.rb +3 -1
- data/lib/oembed/providers.rb +22 -11
- data/lib/oembed/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df140265a8211e31df4eb3f834129cc668f5f5f6
|
4
|
+
data.tar.gz: 85edf877956511443e620e6d07302b2ff497e384
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d4732677011956298e97b60fdd2f1e380be50527ab30d91c6614a12942803dceb167e90ce157485fbcec2a936e0522cfe9c85bedf9bd30120a96b8a5f8a543d
|
7
|
+
data.tar.gz: fbce3399d97a9ad8003c439db17fd8ed0f43342cbb2dd26c3d5e4df66fa94a032d3affc9e6e12ae4f8111487971102db95df1b172eea270d63b4f573e86942a2
|
data/.travis.yml
CHANGED
data/CHANGELOG.rdoc
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
= CHANGELOG
|
2
2
|
|
3
|
+
== 0.8.11 - 7 November 2014
|
4
|
+
|
5
|
+
* Add built-in provider for Spotify; Pull #36 (Sami Kukkonen)
|
6
|
+
* Update Travis CI configuration to test with modern Rails; Pull #37 (Sami Kukkonen)
|
7
|
+
|
3
8
|
== 0.8.10 - 6 August 2014
|
4
9
|
|
5
10
|
* Add support for specifying a Provider#get `:timeout`; Pull #35 (Blake Thomson)
|
data/lib/oembed/provider.rb
CHANGED
@@ -136,7 +136,9 @@ module OEmbed
|
|
136
136
|
http.read_timeout = http.open_timeout = query[:timeout] if query[:timeout]
|
137
137
|
|
138
138
|
%w{scheme userinfo host port registry}.each { |method| uri.send("#{method}=", nil) }
|
139
|
-
|
139
|
+
req = Net::HTTP::Get.new(uri.to_s)
|
140
|
+
req['User-Agent'] = "Mozilla/5.0 (compatible; ruby-oembed/#{OEmbed::VERSION})"
|
141
|
+
res = http.request(req)
|
140
142
|
|
141
143
|
#res = Net::HTTP.start(uri.host, uri.port) {|http| http.get(uri.request_uri) }
|
142
144
|
|
data/lib/oembed/providers.rb
CHANGED
@@ -107,9 +107,9 @@ module OEmbed
|
|
107
107
|
raise(OEmbed::NotFound)
|
108
108
|
end
|
109
109
|
end
|
110
|
-
|
110
|
+
|
111
111
|
private
|
112
|
-
|
112
|
+
|
113
113
|
# Takes an OEmbed::Provider instance and registers it so that when we call
|
114
114
|
# the register_all method, they all register. The sub_type can be be any value
|
115
115
|
# used to uniquely group providers. Official sub_types are:
|
@@ -118,14 +118,14 @@ module OEmbed
|
|
118
118
|
def add_official_provider(provider_class, sub_type=nil)
|
119
119
|
raise TypeError, "Expected OEmbed::Provider instance but was #{provider_class.class}" \
|
120
120
|
unless provider_class.is_a?(OEmbed::Provider)
|
121
|
-
|
121
|
+
|
122
122
|
@@to_register[sub_type.to_s] ||= []
|
123
123
|
@@to_register[sub_type.to_s] << provider_class
|
124
124
|
end
|
125
125
|
end
|
126
126
|
|
127
127
|
# Custom providers:
|
128
|
-
|
128
|
+
|
129
129
|
# Provider for youtube.com
|
130
130
|
# http://apiblog.youtube.com/2009/10/oembed-support.html
|
131
131
|
#
|
@@ -178,27 +178,27 @@ module OEmbed
|
|
178
178
|
Vimeo << "http://*.vimeo.com/*"
|
179
179
|
Vimeo << "https://*.vimeo.com/*"
|
180
180
|
add_official_provider(Vimeo)
|
181
|
-
|
181
|
+
|
182
182
|
# Provider for instagram.com
|
183
183
|
# http://instagr.am/developer/embedding/
|
184
184
|
Instagram = OEmbed::Provider.new("http://api.instagram.com/oembed", :json)
|
185
185
|
Instagram << "http://instagr.am/p/*"
|
186
186
|
Instagram << "http://instagram.com/p/*"
|
187
187
|
add_official_provider(Instagram)
|
188
|
-
|
188
|
+
|
189
189
|
# Provider for slideshare.net
|
190
190
|
# http://www.slideshare.net/developers/oembed
|
191
191
|
Slideshare = OEmbed::Provider.new("http://www.slideshare.net/api/oembed/2")
|
192
192
|
Slideshare << "http://www.slideshare.net/*/*"
|
193
193
|
Slideshare << "http://www.slideshare.net/mobile/*/*"
|
194
194
|
add_official_provider(Slideshare)
|
195
|
-
|
195
|
+
|
196
196
|
# Provider for yfrog
|
197
197
|
# http://code.google.com/p/imageshackapi/wiki/OEMBEDSupport
|
198
198
|
Yfrog = OEmbed::Provider.new("http://www.yfrog.com/api/oembed", :json)
|
199
199
|
Yfrog << "http://yfrog.com/*"
|
200
200
|
add_official_provider(Yfrog)
|
201
|
-
|
201
|
+
|
202
202
|
# provider for mlg-tv
|
203
203
|
# http://tv.majorleaguegaming.com/oembed
|
204
204
|
MlgTv = OEmbed::Provider.new("http://tv.majorleaguegaming.com/oembed")
|
@@ -248,7 +248,7 @@ module OEmbed
|
|
248
248
|
TwentyThree = OEmbed::Provider.new("http://www.23hq.com/23/oembed")
|
249
249
|
TwentyThree << "http://www.23hq.com/*"
|
250
250
|
add_official_provider(TwentyThree)
|
251
|
-
|
251
|
+
|
252
252
|
# Provider for soundcloud.com
|
253
253
|
# http://developers.soundcloud.com/docs/oembed
|
254
254
|
SoundCloud = OEmbed::Provider.new("http://soundcloud.com/oembed", :json)
|
@@ -256,6 +256,17 @@ module OEmbed
|
|
256
256
|
SoundCloud << "https://*.soundcloud.com/*"
|
257
257
|
add_official_provider(SoundCloud)
|
258
258
|
|
259
|
+
# Provider for spotify.com
|
260
|
+
# https://twitter.com/nicklas2k/status/330094611202723840
|
261
|
+
# http://blog.embed.ly/post/45149936446/oembed-for-spotify
|
262
|
+
Spotify = OEmbed::Provider.new("https://embed.spotify.com/oembed/")
|
263
|
+
Spotify << "http://open.spotify.com/*"
|
264
|
+
Spotify << "https://open.spotify.com/*"
|
265
|
+
Spotify << "http://play.spotify.com/*"
|
266
|
+
Spotify << "https://play.spotify.com/*"
|
267
|
+
Spotify << /^spotify\:(.*?)/
|
268
|
+
add_official_provider(Spotify)
|
269
|
+
|
259
270
|
# Provider for skitch.com
|
260
271
|
# http://skitch.com/oembed/%3C/endpoint
|
261
272
|
Skitch = OEmbed::Provider.new("http://skitch.com/oembed")
|
@@ -268,7 +279,7 @@ module OEmbed
|
|
268
279
|
#Clickthrough = OEmbed::Provider.new("http://www.clikthrough.com/services/oembed/")
|
269
280
|
#Clickthrough << "http://*.clikthrough.com/theater/video/*"
|
270
281
|
#add_official_provider(Clickthrough)
|
271
|
-
|
282
|
+
|
272
283
|
## Provider for kinomap.com
|
273
284
|
# http://www.kinomap.com/#!oEmbed
|
274
285
|
#Kinomap = OEmbed::Provider.new("http://www.kinomap.com/oembed")
|
@@ -321,7 +332,7 @@ module OEmbed
|
|
321
332
|
#
|
322
333
|
# You can append your Embed.ly API key to the provider so that all requests are signed
|
323
334
|
# OEmbed::Providers::Embedly.endpoint += "?key=#{my_embedly_key}"
|
324
|
-
#
|
335
|
+
#
|
325
336
|
# If you don't yet have an API key you'll need to sign up here: http://embed.ly/pricing
|
326
337
|
Embedly = OEmbed::Provider.new("http://api.embed.ly/1/oembed")
|
327
338
|
# Add all known URL regexps for Embedly. To update this list run `rake oembed:update_embedly`
|
data/lib/oembed/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-oembed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Magnus Holm
|
@@ -184,7 +184,7 @@ rdoc_options:
|
|
184
184
|
- "--main"
|
185
185
|
- README.rdoc
|
186
186
|
- "--title"
|
187
|
-
- ruby-oembed-0.8.
|
187
|
+
- ruby-oembed-0.8.11
|
188
188
|
- "--inline-source"
|
189
189
|
- "--exclude"
|
190
190
|
- tasks
|