embedly 1.4.1 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +5 -0
- data/VERSION +1 -1
- data/features/oembed.feature +11 -0
- data/lib/embedly/api.rb +18 -11
- metadata +3 -3
data/ChangeLog
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.5.0
|
data/features/oembed.feature
CHANGED
@@ -78,3 +78,14 @@ Feature: OEmbed
|
|
78
78
|
| http://www.youtube.com/watch/a/bassd/url,http://www.youtube.com/watch/ldf/asdlfj | 404,404 | error,error |
|
79
79
|
| http://www.youtube.com/watch/zzzzasdf/kl,http://yfrog.com/h7qqespj | 404, | error,photo |
|
80
80
|
| http://yfrog.com/h7qqespj,http://www.youtube.com/watch/asdfasdfasdf | ,404 | photo,error |
|
81
|
+
|
82
|
+
Scenario Outline: Attempt to get 414 URL
|
83
|
+
Given an embedly api with key
|
84
|
+
When oembed is called with the <url> URL
|
85
|
+
Then type should be error
|
86
|
+
And error_code should be 414
|
87
|
+
And type should be error
|
88
|
+
|
89
|
+
Examples:
|
90
|
+
| url |
|
91
|
+
| http://www.youtube.com/watch/is/a/bad/url/because/it/is/longer/than/2048/characters/this/is/much/too/long/for/a/url/and/shouldnt/even/be/sent/to/the/server/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
data/lib/embedly/api.rb
CHANGED
@@ -120,17 +120,24 @@ class Embedly::API
|
|
120
120
|
|
121
121
|
# store unsupported services as errors and don't send them to embedly
|
122
122
|
rejects = []
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
123
|
+
|
124
|
+
params[:urls].reject!.with_index do |url, i|
|
125
|
+
if !key && url !~ services_regex
|
126
|
+
rejects << [i,
|
127
|
+
Embedly::EmbedlyObject.new(
|
128
|
+
:type => 'error',
|
129
|
+
:error_code => 401,
|
130
|
+
:error_message => 'Embedly api key is required.'
|
131
|
+
)
|
132
|
+
]
|
133
|
+
elsif url.length > 2048
|
134
|
+
rejects << [i,
|
135
|
+
Embedly::EmbedlyObject.new(
|
136
|
+
:type => 'error',
|
137
|
+
:error_code => 414,
|
138
|
+
:error_message => 'URL too long.'
|
139
|
+
)
|
140
|
+
]
|
134
141
|
end
|
135
142
|
end
|
136
143
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: embedly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.
|
5
|
+
version: 1.5.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Bob Corsaro
|
@@ -13,7 +13,7 @@ autorequire:
|
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
15
|
|
16
|
-
date: 2011-11-
|
16
|
+
date: 2011-11-22 00:00:00 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: querystring
|
@@ -165,7 +165,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
165
165
|
requirements:
|
166
166
|
- - ">="
|
167
167
|
- !ruby/object:Gem::Version
|
168
|
-
hash:
|
168
|
+
hash: 2804359751864908164
|
169
169
|
segments:
|
170
170
|
- 0
|
171
171
|
version: "0"
|