embedly 1.5.6 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/bin/embedly_extract +12 -0
- data/features/objectify.feature +1 -1
- data/features/oembed.feature +3 -3
- data/lib/embedly/api.rb +7 -4
- metadata +101 -144
data/README.rdoc
CHANGED
@@ -41,7 +41,7 @@ You can find rdocs at http://rubydoc.info/github/embedly/embedly-ruby/master/fra
|
|
41
41
|
# multiple urls with opts
|
42
42
|
objs = embedly_api.oembed(
|
43
43
|
:urls => ['http://www.youtube.com/watch?v=sPbJ4Z5D-n4&feature=topvideos', 'http://twitpic.com/3yr7hk'],
|
44
|
-
:
|
44
|
+
:maxwidth => 450,
|
45
45
|
:wmode => 'transparent',
|
46
46
|
:method => 'after'
|
47
47
|
)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.6.0
|
data/bin/embedly_extract
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
$:.unshift(File.expand_path('../../lib', __FILE__))
|
3
|
+
%w{embedly embedly/command_line json optparse ostruct}.each {|l| require l}
|
4
|
+
|
5
|
+
api = Embedly::CommandLine.run!(:extract, ARGV)
|
6
|
+
|
7
|
+
begin
|
8
|
+
data = api.flatten.collect { |o| o.marshal_dump }
|
9
|
+
puts JSON.pretty_generate(data)
|
10
|
+
rescue Embedly::BadResponseException => e
|
11
|
+
puts "#{e.response.code} :: #{e.response.message}"
|
12
|
+
end
|
data/features/objectify.feature
CHANGED
data/features/oembed.feature
CHANGED
@@ -15,9 +15,9 @@ Feature: OEmbed
|
|
15
15
|
| http://www.scribd.com/doc/28452730/Easter-Cards | http://www.scribd.com/ |
|
16
16
|
| http://www.youtube.com/watch?v=Zk7dDekYej0 | http://www.youtube.com/ |
|
17
17
|
| http://yfrog.com/h7qqespj | http://yfrog.com |
|
18
|
-
| http://blog.embed.ly/bob | http://
|
19
|
-
| http://blog.doki-pen.org/cassandra-rules | http://blog.doki-pen.org
|
20
|
-
| http://www.guardian.co.uk/media/2011/jan/21/andy-coulson-phone-hacking-statement | http://www.guardian.co.uk
|
18
|
+
| http://blog.embed.ly/bob | http://tumblr.com |
|
19
|
+
| http://blog.doki-pen.org/cassandra-rules | http://blog.doki-pen.org |
|
20
|
+
| http://www.guardian.co.uk/media/2011/jan/21/andy-coulson-phone-hacking-statement | http://www.guardian.co.uk |
|
21
21
|
|
22
22
|
|
23
23
|
Scenario Outline: Get the types
|
data/lib/embedly/api.rb
CHANGED
@@ -22,6 +22,7 @@ end
|
|
22
22
|
# * +oembed+
|
23
23
|
# * +objectify+
|
24
24
|
# * +preview+
|
25
|
+
# * +extract+
|
25
26
|
#
|
26
27
|
# All methods return ostructs, so fields can be accessed with the dot operator. ex.
|
27
28
|
#
|
@@ -52,7 +53,7 @@ class Embedly::API
|
|
52
53
|
# [:+timeout+] Request timeout (in seconds). Defaults to 180 seconds or 3 minutes
|
53
54
|
# [:+headers+] Additional headers to send with requests.
|
54
55
|
def initialize opts={}
|
55
|
-
@endpoints = [:oembed, :objectify, :preview]
|
56
|
+
@endpoints = [:oembed, :objectify, :preview, :extract]
|
56
57
|
@key = opts[:key]
|
57
58
|
@secret = opts[:secret] == "" ? nil : opts[:secret]
|
58
59
|
@api_version = Hash.new('1')
|
@@ -102,7 +103,8 @@ class Embedly::API
|
|
102
103
|
end
|
103
104
|
end
|
104
105
|
|
105
|
-
# <b>Use methods oembed, objectify, preview in favor of
|
106
|
+
# <b>Use methods oembed, objectify, preview and extract in favor of
|
107
|
+
# this method.</b>
|
106
108
|
#
|
107
109
|
# Normalizes url and urls parameters and calls the endpoint. url OR urls
|
108
110
|
# must be present
|
@@ -111,8 +113,8 @@ class Embedly::API
|
|
111
113
|
#
|
112
114
|
# [:+url+] _(optional)_ A single url
|
113
115
|
# [:+urls+] _(optional)_ An array of urls
|
114
|
-
# [:+action+] The method that should be called. ex. oembed, objectify,
|
115
|
-
# [:+version+] The api version number.
|
116
|
+
# [:+action+] The method that should be called. ex. oembed, objectify,
|
117
|
+
# preview, extract [:+version+] The api version number.
|
116
118
|
# [_others_] All other parameters are used as query strings.
|
117
119
|
def apicall opts
|
118
120
|
opts[:urls] ||= []
|
@@ -205,6 +207,7 @@ class Embedly::API
|
|
205
207
|
# - +oembed+
|
206
208
|
# - +objectify+
|
207
209
|
# - +preview+
|
210
|
+
# - +extract+
|
208
211
|
#
|
209
212
|
def method_missing(name, *args, &block)
|
210
213
|
if @endpoints.include?name
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: embedly
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.6
|
3
|
+
version: !ruby/object:Gem::Version
|
5
4
|
prerelease:
|
5
|
+
version: 1.6.0
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Bob Corsaro
|
9
9
|
- Felipe Elias Philipp
|
10
10
|
- Russ Bradberry
|
@@ -12,179 +12,132 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
|
16
|
+
date: 2013-04-02 00:00:00 Z
|
17
|
+
dependencies:
|
18
|
+
- !ruby/object:Gem::Dependency
|
18
19
|
name: querystring
|
19
|
-
requirement: !ruby/object:Gem::Requirement
|
20
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
21
|
none: false
|
21
|
-
requirements:
|
22
|
-
- -
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version:
|
22
|
+
requirements:
|
23
|
+
- - ">="
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: "0"
|
25
26
|
type: :runtime
|
26
27
|
prerelease: false
|
27
|
-
version_requirements:
|
28
|
-
|
29
|
-
requirements:
|
30
|
-
- - ! '>='
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '0'
|
33
|
-
- !ruby/object:Gem::Dependency
|
28
|
+
version_requirements: *id001
|
29
|
+
- !ruby/object:Gem::Dependency
|
34
30
|
name: oauth
|
35
|
-
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
36
32
|
none: false
|
37
|
-
requirements:
|
38
|
-
- -
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version:
|
33
|
+
requirements:
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: "0"
|
41
37
|
type: :runtime
|
42
38
|
prerelease: false
|
43
|
-
version_requirements:
|
44
|
-
|
45
|
-
requirements:
|
46
|
-
- - ! '>='
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: '0'
|
49
|
-
- !ruby/object:Gem::Dependency
|
39
|
+
version_requirements: *id002
|
40
|
+
- !ruby/object:Gem::Dependency
|
50
41
|
name: json
|
51
|
-
requirement: !ruby/object:Gem::Requirement
|
42
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
52
43
|
none: false
|
53
|
-
requirements:
|
54
|
-
- -
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version:
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: "0"
|
57
48
|
type: :runtime
|
58
49
|
prerelease: false
|
59
|
-
version_requirements:
|
60
|
-
|
61
|
-
requirements:
|
62
|
-
- - ! '>='
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: '0'
|
65
|
-
- !ruby/object:Gem::Dependency
|
50
|
+
version_requirements: *id003
|
51
|
+
- !ruby/object:Gem::Dependency
|
66
52
|
name: typhoeus
|
67
|
-
requirement: !ruby/object:Gem::Requirement
|
53
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
68
54
|
none: false
|
69
|
-
requirements:
|
70
|
-
- -
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version:
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: "0"
|
73
59
|
type: :runtime
|
74
60
|
prerelease: false
|
75
|
-
version_requirements:
|
76
|
-
|
77
|
-
requirements:
|
78
|
-
- - ! '>='
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
version: '0'
|
81
|
-
- !ruby/object:Gem::Dependency
|
61
|
+
version_requirements: *id004
|
62
|
+
- !ruby/object:Gem::Dependency
|
82
63
|
name: jeweler
|
83
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
84
65
|
none: false
|
85
|
-
requirements:
|
86
|
-
- -
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version:
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: "0"
|
89
70
|
type: :development
|
90
71
|
prerelease: false
|
91
|
-
version_requirements:
|
92
|
-
|
93
|
-
requirements:
|
94
|
-
- - ! '>='
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
72
|
+
version_requirements: *id005
|
73
|
+
- !ruby/object:Gem::Dependency
|
98
74
|
name: cucumber
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
75
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
100
76
|
none: false
|
101
|
-
requirements:
|
102
|
-
- -
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
version:
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: "0"
|
105
81
|
type: :development
|
106
82
|
prerelease: false
|
107
|
-
version_requirements:
|
108
|
-
|
109
|
-
requirements:
|
110
|
-
- - ! '>='
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
version: '0'
|
113
|
-
- !ruby/object:Gem::Dependency
|
83
|
+
version_requirements: *id006
|
84
|
+
- !ruby/object:Gem::Dependency
|
114
85
|
name: rake
|
115
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
116
87
|
none: false
|
117
|
-
requirements:
|
118
|
-
- -
|
119
|
-
- !ruby/object:Gem::Version
|
120
|
-
version:
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: "0"
|
121
92
|
type: :development
|
122
93
|
prerelease: false
|
123
|
-
version_requirements:
|
124
|
-
|
125
|
-
requirements:
|
126
|
-
- - ! '>='
|
127
|
-
- !ruby/object:Gem::Version
|
128
|
-
version: '0'
|
129
|
-
- !ruby/object:Gem::Dependency
|
94
|
+
version_requirements: *id007
|
95
|
+
- !ruby/object:Gem::Dependency
|
130
96
|
name: rspec
|
131
|
-
requirement: !ruby/object:Gem::Requirement
|
97
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
132
98
|
none: false
|
133
|
-
requirements:
|
134
|
-
- -
|
135
|
-
- !ruby/object:Gem::Version
|
136
|
-
version:
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: "0"
|
137
103
|
type: :development
|
138
104
|
prerelease: false
|
139
|
-
version_requirements:
|
140
|
-
|
141
|
-
requirements:
|
142
|
-
- - ! '>='
|
143
|
-
- !ruby/object:Gem::Version
|
144
|
-
version: '0'
|
145
|
-
- !ruby/object:Gem::Dependency
|
105
|
+
version_requirements: *id008
|
106
|
+
- !ruby/object:Gem::Dependency
|
146
107
|
name: yard
|
147
|
-
requirement: !ruby/object:Gem::Requirement
|
108
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
148
109
|
none: false
|
149
|
-
requirements:
|
150
|
-
- -
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version:
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: "0"
|
153
114
|
type: :development
|
154
115
|
prerelease: false
|
155
|
-
version_requirements:
|
156
|
-
|
157
|
-
requirements:
|
158
|
-
- - ! '>='
|
159
|
-
- !ruby/object:Gem::Version
|
160
|
-
version: '0'
|
161
|
-
- !ruby/object:Gem::Dependency
|
116
|
+
version_requirements: *id009
|
117
|
+
- !ruby/object:Gem::Dependency
|
162
118
|
name: aruba
|
163
|
-
requirement: !ruby/object:Gem::Requirement
|
119
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
164
120
|
none: false
|
165
|
-
requirements:
|
166
|
-
- -
|
167
|
-
- !ruby/object:Gem::Version
|
168
|
-
version:
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: "0"
|
169
125
|
type: :development
|
170
126
|
prerelease: false
|
171
|
-
version_requirements:
|
172
|
-
none: false
|
173
|
-
requirements:
|
174
|
-
- - ! '>='
|
175
|
-
- !ruby/object:Gem::Version
|
176
|
-
version: '0'
|
127
|
+
version_requirements: *id010
|
177
128
|
description: Ruby Embedly client library
|
178
129
|
email: bob@embed.ly
|
179
|
-
executables:
|
130
|
+
executables:
|
131
|
+
- embedly_extract
|
180
132
|
- embedly_objectify
|
181
133
|
- embedly_oembed
|
182
134
|
- embedly_preview
|
183
135
|
extensions: []
|
184
|
-
|
136
|
+
|
137
|
+
extra_rdoc_files:
|
185
138
|
- ChangeLog
|
186
139
|
- README.rdoc
|
187
|
-
files:
|
140
|
+
files:
|
188
141
|
- .rvmrc
|
189
142
|
- ChangeLog
|
190
143
|
- Gemfile
|
@@ -192,6 +145,7 @@ files:
|
|
192
145
|
- README.rdoc
|
193
146
|
- Rakefile
|
194
147
|
- VERSION
|
148
|
+
- bin/embedly_extract
|
195
149
|
- bin/embedly_objectify
|
196
150
|
- bin/embedly_oembed
|
197
151
|
- bin/embedly_preview
|
@@ -212,31 +166,34 @@ files:
|
|
212
166
|
- spec/embedly/configuration_spec.rb
|
213
167
|
- spec/spec_helper.rb
|
214
168
|
homepage: http://github.com/embedly/embedly-ruby
|
215
|
-
licenses:
|
169
|
+
licenses:
|
216
170
|
- MIT
|
217
171
|
post_install_message:
|
218
172
|
rdoc_options: []
|
219
|
-
|
173
|
+
|
174
|
+
require_paths:
|
220
175
|
- lib
|
221
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
176
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
222
177
|
none: false
|
223
|
-
requirements:
|
224
|
-
- -
|
225
|
-
- !ruby/object:Gem::Version
|
226
|
-
|
227
|
-
segments:
|
178
|
+
requirements:
|
179
|
+
- - ">="
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
hash: -573955197578179055
|
182
|
+
segments:
|
228
183
|
- 0
|
229
|
-
|
230
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
184
|
+
version: "0"
|
185
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
231
186
|
none: false
|
232
|
-
requirements:
|
233
|
-
- -
|
234
|
-
- !ruby/object:Gem::Version
|
235
|
-
version:
|
187
|
+
requirements:
|
188
|
+
- - ">="
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: "0"
|
236
191
|
requirements: []
|
192
|
+
|
237
193
|
rubyforge_project:
|
238
|
-
rubygems_version: 1.8.
|
194
|
+
rubygems_version: 1.8.25
|
239
195
|
signing_key:
|
240
196
|
specification_version: 3
|
241
197
|
summary: Ruby Embedly client library
|
242
198
|
test_files: []
|
199
|
+
|