gdata_19 1.1.3 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.mdown +103 -0
- data/Rakefile +12 -3
- data/gdata_19.gemspec +260 -263
- data/lib/gdata/client.rb +1 -0
- data/lib/gdata/client/analytics.rb +29 -0
- data/lib/gdata/client/base.rb +2 -2
- data/lib/gdata/http/default_service.rb +2 -1
- data/pkg/gdata_19-1.1.3.gem +0 -0
- data/test/tc_gdata_http_request.rb +4 -1
- data/test/test_helper.rb +9 -2
- data/test/ts_gdata.rb +1 -1
- metadata +10 -10
- data/README +0 -97
data/README.mdown
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
# GData (Ruby 1.9.2 compatible)
|
2
|
+
|
3
|
+
* http://code.google.com/p/gdata
|
4
|
+
|
5
|
+
## DESCRIPTION:
|
6
|
+
|
7
|
+
Ruby wrapper for working with Google Data APIs
|
8
|
+
|
9
|
+
## SYNOPSIS:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
yt = GData::Client::YouTube.new
|
13
|
+
yt.source = 'my_cool_application'
|
14
|
+
yt.clientlogin('username', 'password')
|
15
|
+
yt.client_id = 'CLIENT_ID'
|
16
|
+
yt.developer_key = 'DEVELOPER_KEY'
|
17
|
+
feed = yt.get('http://gdata.youtube.com/feeds/api/users/default/uploads').to_xml
|
18
|
+
```
|
19
|
+
|
20
|
+
### creating, updating, and deleting a playlist
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
entry = <<-EOF
|
24
|
+
<entry xmlns="http://www.w3.org/2005/Atom"
|
25
|
+
xmlns:yt="http://gdata.youtube.com/schemas/2007">
|
26
|
+
<title type="text">Ruby Utility Unit Test</title>
|
27
|
+
<summary>This is a test playlist.</summary>
|
28
|
+
</entry>
|
29
|
+
EOF
|
30
|
+
|
31
|
+
response = yt.post('http://gdata.youtube.com/feeds/api/users/default/playlists', entry).to_xml
|
32
|
+
|
33
|
+
edit_uri = response.elements["link[@rel='edit']"].attributes['href']
|
34
|
+
|
35
|
+
response.elements["summary"].text = "Updated description"
|
36
|
+
|
37
|
+
response = yt.put(edit_uri, response.to_s).to_xml
|
38
|
+
|
39
|
+
yt.delete(edit_uri).to_xml
|
40
|
+
```
|
41
|
+
|
42
|
+
### uploading a video
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
test_movie = '/path/to/a/movie.mov'
|
46
|
+
mime_type = 'video/quicktime'
|
47
|
+
feed = 'http://uploads.gdata.youtube.com/feeds/api/users/default/uploads'
|
48
|
+
|
49
|
+
entry = <<EOF
|
50
|
+
<entry xmlns="http://www.w3.org/2005/Atom"
|
51
|
+
xmlns:media="http://search.yahoo.com/mrss/"
|
52
|
+
xmlns:yt="http://gdata.youtube.com/schemas/2007">
|
53
|
+
<media:group>
|
54
|
+
<media:title type="plain">Test Movie</media:title>
|
55
|
+
<media:description type="plain">
|
56
|
+
This is a test with the Ruby library
|
57
|
+
</media:description>
|
58
|
+
<media:category
|
59
|
+
scheme="http://gdata.youtube.com/schemas/2007/categories.cat">People
|
60
|
+
</media:category>
|
61
|
+
<media:keywords>test,lame</media:keywords>
|
62
|
+
</media:group>
|
63
|
+
</entry>
|
64
|
+
EOF
|
65
|
+
|
66
|
+
response = @yt.post_file(feed, test_movie, mime_type, entry).to_xml
|
67
|
+
```
|
68
|
+
|
69
|
+
## REQUIREMENTS:
|
70
|
+
|
71
|
+
* A sunny disposition
|
72
|
+
|
73
|
+
Tested against Ruby 1.8.6p114 and 1.9.2p290
|
74
|
+
|
75
|
+
## INSTALL:
|
76
|
+
|
77
|
+
sudo gem install gdata_19
|
78
|
+
|
79
|
+
To generate documentation:
|
80
|
+
|
81
|
+
rake doc
|
82
|
+
|
83
|
+
To run unit tests:
|
84
|
+
|
85
|
+
cp test/test_config.yml.example test/test_config.yml
|
86
|
+
# edit test/test_config.yml
|
87
|
+
rake test
|
88
|
+
|
89
|
+
## LICENSE:
|
90
|
+
|
91
|
+
Copyright (C) 2008 Google Inc.
|
92
|
+
|
93
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
94
|
+
you may not use this file except in compliance with the License.
|
95
|
+
You may obtain a copy of the License at
|
96
|
+
|
97
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
98
|
+
|
99
|
+
Unless required by applicable law or agreed to in writing, software
|
100
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
101
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
102
|
+
See the License for the specific language governing permissions and
|
103
|
+
limitations under the License.
|
data/Rakefile
CHANGED
@@ -13,8 +13,17 @@
|
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
15
|
require 'rubygems'
|
16
|
-
|
17
|
-
|
16
|
+
|
17
|
+
if RUBY_VERSION > '1.9.1'
|
18
|
+
require 'rubygems/package_task'
|
19
|
+
require 'rdoc/task'
|
20
|
+
elsif RUBY_VERSION > '1.9'
|
21
|
+
require 'rubygems/package_task'
|
22
|
+
else
|
23
|
+
require 'rake/gempackagetask'
|
24
|
+
require 'rake/rdoctask'
|
25
|
+
end
|
26
|
+
|
18
27
|
require 'rake/testtask'
|
19
28
|
|
20
29
|
task :default => [:test]
|
@@ -58,7 +67,7 @@ the Google Data APIs.
|
|
58
67
|
EOF
|
59
68
|
end
|
60
69
|
|
61
|
-
|
70
|
+
Gem::PackageTask.new(spec) do |pkg|
|
62
71
|
pkg.need_zip = true
|
63
72
|
pkg.need_tar = true
|
64
73
|
end
|
data/gdata_19.gemspec
CHANGED
@@ -1,291 +1,288 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{gdata_19}
|
8
|
-
s.version = "1.1.
|
8
|
+
s.version = "1.1.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jeff Fisher"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2012-04-06}
|
13
13
|
s.default_executable = %q{test_captcha.rb}
|
14
|
-
s.description = %q{
|
15
|
-
the Google Data APIs with 1.9 compat}
|
14
|
+
s.description = %q{Ruby 1.9.x compatible Google GData gem makes it easy to work with the Google Data APIs}
|
16
15
|
s.email = %q{jfisher@youtube.com}
|
17
16
|
s.executables = ["test_captcha.rb"]
|
18
17
|
s.extra_rdoc_files = [
|
19
18
|
"LICENSE",
|
20
|
-
|
19
|
+
"README.mdown"
|
21
20
|
]
|
22
21
|
s.files = [
|
23
22
|
".hgtags",
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
23
|
+
"LICENSE",
|
24
|
+
"README.mdown",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"bin/test_captcha.rb",
|
28
|
+
"doc/classes/GData.html",
|
29
|
+
"doc/classes/GData/Auth.html",
|
30
|
+
"doc/classes/GData/Auth/AuthSub.html",
|
31
|
+
"doc/classes/GData/Auth/AuthSub.src/M000020.html",
|
32
|
+
"doc/classes/GData/Auth/AuthSub.src/M000021.html",
|
33
|
+
"doc/classes/GData/Auth/AuthSub.src/M000022.html",
|
34
|
+
"doc/classes/GData/Auth/AuthSub.src/M000023.html",
|
35
|
+
"doc/classes/GData/Auth/AuthSub.src/M000024.html",
|
36
|
+
"doc/classes/GData/Auth/AuthSub.src/M000025.html",
|
37
|
+
"doc/classes/GData/Auth/AuthSub.src/M000026.html",
|
38
|
+
"doc/classes/GData/Auth/AuthSub.src/M000038.html",
|
39
|
+
"doc/classes/GData/Auth/AuthSub.src/M000039.html",
|
40
|
+
"doc/classes/GData/Auth/AuthSub.src/M000040.html",
|
41
|
+
"doc/classes/GData/Auth/AuthSub.src/M000041.html",
|
42
|
+
"doc/classes/GData/Auth/AuthSub.src/M000042.html",
|
43
|
+
"doc/classes/GData/Auth/AuthSub.src/M000043.html",
|
44
|
+
"doc/classes/GData/Auth/AuthSub.src/M000044.html",
|
45
|
+
"doc/classes/GData/Auth/AuthSub.src/M000045.html",
|
46
|
+
"doc/classes/GData/Auth/AuthSub.src/M000046.html",
|
47
|
+
"doc/classes/GData/Auth/AuthSub.src/M000047.html",
|
48
|
+
"doc/classes/GData/Auth/AuthSub.src/M000048.html",
|
49
|
+
"doc/classes/GData/Auth/AuthSub.src/M000049.html",
|
50
|
+
"doc/classes/GData/Auth/AuthSub.src/M000050.html",
|
51
|
+
"doc/classes/GData/Auth/AuthSub.src/M000051.html",
|
52
|
+
"doc/classes/GData/Auth/AuthSub.src/M000052.html",
|
53
|
+
"doc/classes/GData/Auth/AuthSub.src/M000053.html",
|
54
|
+
"doc/classes/GData/Auth/ClientLogin.html",
|
55
|
+
"doc/classes/GData/Auth/ClientLogin.src/M000027.html",
|
56
|
+
"doc/classes/GData/Auth/ClientLogin.src/M000028.html",
|
57
|
+
"doc/classes/GData/Auth/ClientLogin.src/M000029.html",
|
58
|
+
"doc/classes/GData/Auth/ClientLogin.src/M000045.html",
|
59
|
+
"doc/classes/GData/Auth/ClientLogin.src/M000046.html",
|
60
|
+
"doc/classes/GData/Auth/ClientLogin.src/M000047.html",
|
61
|
+
"doc/classes/GData/Auth/ClientLogin.src/M000050.html",
|
62
|
+
"doc/classes/GData/Auth/ClientLogin.src/M000051.html",
|
63
|
+
"doc/classes/GData/Auth/ClientLogin.src/M000052.html",
|
64
|
+
"doc/classes/GData/Auth/ClientLogin.src/M000053.html",
|
65
|
+
"doc/classes/GData/Auth/ClientLogin.src/M000054.html",
|
66
|
+
"doc/classes/GData/Auth/ClientLogin.src/M000055.html",
|
67
|
+
"doc/classes/GData/Auth/ClientLogin.src/M000056.html",
|
68
|
+
"doc/classes/GData/Client.html",
|
69
|
+
"doc/classes/GData/Client/Apps.html",
|
70
|
+
"doc/classes/GData/Client/Apps.src/M000027.html",
|
71
|
+
"doc/classes/GData/Client/Apps.src/M000028.html",
|
72
|
+
"doc/classes/GData/Client/AuthorizationError.html",
|
73
|
+
"doc/classes/GData/Client/BadRequestError.html",
|
74
|
+
"doc/classes/GData/Client/Base.html",
|
75
|
+
"doc/classes/GData/Client/Base.src/M000002.html",
|
76
|
+
"doc/classes/GData/Client/Base.src/M000003.html",
|
77
|
+
"doc/classes/GData/Client/Base.src/M000004.html",
|
78
|
+
"doc/classes/GData/Client/Base.src/M000005.html",
|
79
|
+
"doc/classes/GData/Client/Base.src/M000006.html",
|
80
|
+
"doc/classes/GData/Client/Base.src/M000007.html",
|
81
|
+
"doc/classes/GData/Client/Base.src/M000008.html",
|
82
|
+
"doc/classes/GData/Client/Base.src/M000009.html",
|
83
|
+
"doc/classes/GData/Client/Base.src/M000010.html",
|
84
|
+
"doc/classes/GData/Client/Base.src/M000011.html",
|
85
|
+
"doc/classes/GData/Client/Base.src/M000012.html",
|
86
|
+
"doc/classes/GData/Client/Base.src/M000013.html",
|
87
|
+
"doc/classes/GData/Client/Base.src/M000014.html",
|
88
|
+
"doc/classes/GData/Client/Base.src/M000015.html",
|
89
|
+
"doc/classes/GData/Client/Base.src/M000016.html",
|
90
|
+
"doc/classes/GData/Client/Base.src/M000017.html",
|
91
|
+
"doc/classes/GData/Client/Base.src/M000018.html",
|
92
|
+
"doc/classes/GData/Client/Base.src/M000019.html",
|
93
|
+
"doc/classes/GData/Client/Base.src/M000020.html",
|
94
|
+
"doc/classes/GData/Client/Base.src/M000021.html",
|
95
|
+
"doc/classes/GData/Client/Base.src/M000022.html",
|
96
|
+
"doc/classes/GData/Client/Base.src/M000023.html",
|
97
|
+
"doc/classes/GData/Client/Base.src/M000024.html",
|
98
|
+
"doc/classes/GData/Client/Base.src/M000025.html",
|
99
|
+
"doc/classes/GData/Client/Blogger.html",
|
100
|
+
"doc/classes/GData/Client/Blogger.src/M000002.html",
|
101
|
+
"doc/classes/GData/Client/BookSearch.html",
|
102
|
+
"doc/classes/GData/Client/BookSearch.src/M000010.html",
|
103
|
+
"doc/classes/GData/Client/BookSearch.src/M000011.html",
|
104
|
+
"doc/classes/GData/Client/Calendar.html",
|
105
|
+
"doc/classes/GData/Client/Calendar.src/M000030.html",
|
106
|
+
"doc/classes/GData/Client/Calendar.src/M000031.html",
|
107
|
+
"doc/classes/GData/Client/Calendar.src/M000032.html",
|
108
|
+
"doc/classes/GData/Client/Calendar.src/M000033.html",
|
109
|
+
"doc/classes/GData/Client/Calendar.src/M000034.html",
|
110
|
+
"doc/classes/GData/Client/CaptchaError.html",
|
111
|
+
"doc/classes/GData/Client/CaptchaError.src/M000001.html",
|
112
|
+
"doc/classes/GData/Client/CaptchaError.src/M000005.html",
|
113
|
+
"doc/classes/GData/Client/Contacts.html",
|
114
|
+
"doc/classes/GData/Client/Contacts.src/M000003.html",
|
115
|
+
"doc/classes/GData/Client/DocList.html",
|
116
|
+
"doc/classes/GData/Client/DocList.src/M000006.html",
|
117
|
+
"doc/classes/GData/Client/DocList.src/M000007.html",
|
118
|
+
"doc/classes/GData/Client/Error.html",
|
119
|
+
"doc/classes/GData/Client/Finance.html",
|
120
|
+
"doc/classes/GData/Client/Finance.src/M000029.html",
|
121
|
+
"doc/classes/GData/Client/Finance.src/M000030.html",
|
122
|
+
"doc/classes/GData/Client/GBase.html",
|
123
|
+
"doc/classes/GData/Client/GBase.src/M000004.html",
|
124
|
+
"doc/classes/GData/Client/GMail.html",
|
125
|
+
"doc/classes/GData/Client/GMail.src/M000028.html",
|
126
|
+
"doc/classes/GData/Client/GMail.src/M000029.html",
|
127
|
+
"doc/classes/GData/Client/Health.html",
|
128
|
+
"doc/classes/GData/Client/Health.src/M000031.html",
|
129
|
+
"doc/classes/GData/Client/Health.src/M000034.html",
|
130
|
+
"doc/classes/GData/Client/Health.src/M000035.html",
|
131
|
+
"doc/classes/GData/Client/Notebook.html",
|
132
|
+
"doc/classes/GData/Client/Notebook.src/M000009.html",
|
133
|
+
"doc/classes/GData/Client/Notebook.src/M000010.html",
|
134
|
+
"doc/classes/GData/Client/Photos.html",
|
135
|
+
"doc/classes/GData/Client/Photos.src/M000008.html",
|
136
|
+
"doc/classes/GData/Client/Photos.src/M000009.html",
|
137
|
+
"doc/classes/GData/Client/RequestError.html",
|
138
|
+
"doc/classes/GData/Client/RequestError.src/M000006.html",
|
139
|
+
"doc/classes/GData/Client/ServerError.html",
|
140
|
+
"doc/classes/GData/Client/Spreadsheets.html",
|
141
|
+
"doc/classes/GData/Client/Spreadsheets.src/M000001.html",
|
142
|
+
"doc/classes/GData/Client/UnknownError.html",
|
143
|
+
"doc/classes/GData/Client/VersionConflictError.html",
|
144
|
+
"doc/classes/GData/Client/WebmasterTools.html",
|
145
|
+
"doc/classes/GData/Client/WebmasterTools.src/M000007.html",
|
146
|
+
"doc/classes/GData/Client/WebmasterTools.src/M000008.html",
|
147
|
+
"doc/classes/GData/Client/YouTube.html",
|
148
|
+
"doc/classes/GData/Client/YouTube.src/M000013.html",
|
149
|
+
"doc/classes/GData/Client/YouTube.src/M000014.html",
|
150
|
+
"doc/classes/GData/Client/YouTube.src/M000025.html",
|
151
|
+
"doc/classes/GData/Client/YouTube.src/M000026.html",
|
152
|
+
"doc/classes/GData/Client/YouTube.src/M000027.html",
|
153
|
+
"doc/classes/GData/HTTP.html",
|
154
|
+
"doc/classes/GData/HTTP/DefaultService.html",
|
155
|
+
"doc/classes/GData/HTTP/DefaultService.src/M000019.html",
|
156
|
+
"doc/classes/GData/HTTP/DefaultService.src/M000037.html",
|
157
|
+
"doc/classes/GData/HTTP/DefaultService.src/M000042.html",
|
158
|
+
"doc/classes/GData/HTTP/DefaultService.src/M000045.html",
|
159
|
+
"doc/classes/GData/HTTP/DefaultService.src/M000046.html",
|
160
|
+
"doc/classes/GData/HTTP/MimeBody.html",
|
161
|
+
"doc/classes/GData/HTTP/MimeBody.src/M000032.html",
|
162
|
+
"doc/classes/GData/HTTP/MimeBody.src/M000033.html",
|
163
|
+
"doc/classes/GData/HTTP/MimeBody.src/M000034.html",
|
164
|
+
"doc/classes/GData/HTTP/MimeBody.src/M000035.html",
|
165
|
+
"doc/classes/GData/HTTP/MimeBody.src/M000036.html",
|
166
|
+
"doc/classes/GData/HTTP/MimeBody.src/M000037.html",
|
167
|
+
"doc/classes/GData/HTTP/MimeBody.src/M000038.html",
|
168
|
+
"doc/classes/GData/HTTP/MimeBodyString.html",
|
169
|
+
"doc/classes/GData/HTTP/MimeBodyString.src/M000036.html",
|
170
|
+
"doc/classes/GData/HTTP/MimeBodyString.src/M000037.html",
|
171
|
+
"doc/classes/GData/HTTP/MimeBodyString.src/M000039.html",
|
172
|
+
"doc/classes/GData/HTTP/MimeBodyString.src/M000040.html",
|
173
|
+
"doc/classes/GData/HTTP/MimeBodyString.src/M000041.html",
|
174
|
+
"doc/classes/GData/HTTP/Request.html",
|
175
|
+
"doc/classes/GData/HTTP/Request.src/M000015.html",
|
176
|
+
"doc/classes/GData/HTTP/Request.src/M000016.html",
|
177
|
+
"doc/classes/GData/HTTP/Request.src/M000017.html",
|
178
|
+
"doc/classes/GData/HTTP/Request.src/M000018.html",
|
179
|
+
"doc/classes/GData/HTTP/Request.src/M000033.html",
|
180
|
+
"doc/classes/GData/HTTP/Request.src/M000034.html",
|
181
|
+
"doc/classes/GData/HTTP/Request.src/M000035.html",
|
182
|
+
"doc/classes/GData/HTTP/Request.src/M000036.html",
|
183
|
+
"doc/classes/GData/HTTP/Request.src/M000038.html",
|
184
|
+
"doc/classes/GData/HTTP/Request.src/M000039.html",
|
185
|
+
"doc/classes/GData/HTTP/Request.src/M000040.html",
|
186
|
+
"doc/classes/GData/HTTP/Request.src/M000041.html",
|
187
|
+
"doc/classes/GData/HTTP/Request.src/M000042.html",
|
188
|
+
"doc/classes/GData/HTTP/Request.src/M000043.html",
|
189
|
+
"doc/classes/GData/HTTP/Request.src/M000044.html",
|
190
|
+
"doc/classes/GData/HTTP/Request.src/M000045.html",
|
191
|
+
"doc/classes/GData/HTTP/Response.html",
|
192
|
+
"doc/classes/GData/HTTP/Response.src/M000032.html",
|
193
|
+
"doc/classes/GData/HTTP/Response.src/M000035.html",
|
194
|
+
"doc/classes/GData/HTTP/Response.src/M000038.html",
|
195
|
+
"doc/classes/GData/HTTP/Response.src/M000039.html",
|
196
|
+
"doc/created.rid",
|
197
|
+
"doc/files/README.html",
|
198
|
+
"doc/files/lib/gdata/auth/authsub_rb.html",
|
199
|
+
"doc/files/lib/gdata/auth/clientlogin_rb.html",
|
200
|
+
"doc/files/lib/gdata/auth_rb.html",
|
201
|
+
"doc/files/lib/gdata/client/apps_rb.html",
|
202
|
+
"doc/files/lib/gdata/client/base_rb.html",
|
203
|
+
"doc/files/lib/gdata/client/blogger_rb.html",
|
204
|
+
"doc/files/lib/gdata/client/booksearch_rb.html",
|
205
|
+
"doc/files/lib/gdata/client/calendar_rb.html",
|
206
|
+
"doc/files/lib/gdata/client/contacts_rb.html",
|
207
|
+
"doc/files/lib/gdata/client/doclist_rb.html",
|
208
|
+
"doc/files/lib/gdata/client/finance_rb.html",
|
209
|
+
"doc/files/lib/gdata/client/gbase_rb.html",
|
210
|
+
"doc/files/lib/gdata/client/gdata_rb.html",
|
211
|
+
"doc/files/lib/gdata/client/gmail_rb.html",
|
212
|
+
"doc/files/lib/gdata/client/health_rb.html",
|
213
|
+
"doc/files/lib/gdata/client/notebook_rb.html",
|
214
|
+
"doc/files/lib/gdata/client/photos_rb.html",
|
215
|
+
"doc/files/lib/gdata/client/spreadsheets_rb.html",
|
216
|
+
"doc/files/lib/gdata/client/webmaster_tools_rb.html",
|
217
|
+
"doc/files/lib/gdata/client/youtube_rb.html",
|
218
|
+
"doc/files/lib/gdata/client_rb.html",
|
219
|
+
"doc/files/lib/gdata/http/default_service_rb.html",
|
220
|
+
"doc/files/lib/gdata/http/mime_body_rb.html",
|
221
|
+
"doc/files/lib/gdata/http/request_rb.html",
|
222
|
+
"doc/files/lib/gdata/http/response_rb.html",
|
223
|
+
"doc/files/lib/gdata/http_rb.html",
|
224
|
+
"doc/files/lib/gdata_rb.html",
|
225
|
+
"doc/fr_class_index.html",
|
226
|
+
"doc/fr_file_index.html",
|
227
|
+
"doc/fr_method_index.html",
|
228
|
+
"doc/index.html",
|
229
|
+
"doc/rdoc-style.css",
|
230
|
+
"gdata_19.gemspec",
|
231
|
+
"lib/gdata.rb",
|
232
|
+
"lib/gdata/auth.rb",
|
233
|
+
"lib/gdata/auth/authsub.rb",
|
234
|
+
"lib/gdata/auth/clientlogin.rb",
|
235
|
+
"lib/gdata/client.rb",
|
236
|
+
"lib/gdata/client/analytics.rb",
|
237
|
+
"lib/gdata/client/apps.rb",
|
238
|
+
"lib/gdata/client/base.rb",
|
239
|
+
"lib/gdata/client/blogger.rb",
|
240
|
+
"lib/gdata/client/booksearch.rb",
|
241
|
+
"lib/gdata/client/calendar.rb",
|
242
|
+
"lib/gdata/client/contacts.rb",
|
243
|
+
"lib/gdata/client/doclist.rb",
|
244
|
+
"lib/gdata/client/finance.rb",
|
245
|
+
"lib/gdata/client/gbase.rb",
|
246
|
+
"lib/gdata/client/gmail.rb",
|
247
|
+
"lib/gdata/client/health.rb",
|
248
|
+
"lib/gdata/client/notebook.rb",
|
249
|
+
"lib/gdata/client/photos.rb",
|
250
|
+
"lib/gdata/client/spreadsheets.rb",
|
251
|
+
"lib/gdata/client/webmaster_tools.rb",
|
252
|
+
"lib/gdata/client/youtube.rb",
|
253
|
+
"lib/gdata/http.rb",
|
254
|
+
"lib/gdata/http/default_service.rb",
|
255
|
+
"lib/gdata/http/mime_body.rb",
|
256
|
+
"lib/gdata/http/request.rb",
|
257
|
+
"lib/gdata/http/response.rb",
|
258
|
+
"pkg/gdata_19-1.1.2.gem",
|
259
|
+
"pkg/gdata_19-1.1.3.gem",
|
260
|
+
"test/tc_gdata_auth_authsub.rb",
|
261
|
+
"test/tc_gdata_auth_clientlogin.rb",
|
262
|
+
"test/tc_gdata_client_base.rb",
|
263
|
+
"test/tc_gdata_client_calendar.rb",
|
264
|
+
"test/tc_gdata_client_photos.rb",
|
265
|
+
"test/tc_gdata_client_youtube.rb",
|
266
|
+
"test/tc_gdata_http_mime_body.rb",
|
267
|
+
"test/tc_gdata_http_request.rb",
|
268
|
+
"test/test_config.yml.example",
|
269
|
+
"test/test_helper.rb",
|
270
|
+
"test/testimage.jpg",
|
271
|
+
"test/ts_gdata.rb",
|
272
|
+
"test/ts_gdata_auth.rb",
|
273
|
+
"test/ts_gdata_client.rb",
|
274
|
+
"test/ts_gdata_http.rb"
|
274
275
|
]
|
275
276
|
s.homepage = %q{http://github.com/tokumine/GData}
|
276
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
277
277
|
s.require_paths = ["lib"]
|
278
|
-
s.rubygems_version = %q{1.
|
278
|
+
s.rubygems_version = %q{1.6.2}
|
279
279
|
s.summary = %q{Google Data APIs Ruby Utility Library}
|
280
|
-
s.test_files = [
|
281
|
-
"test/ts_gdata.rb"
|
282
|
-
]
|
280
|
+
s.test_files = ["test/ts_gdata.rb"]
|
283
281
|
|
284
282
|
if s.respond_to? :specification_version then
|
285
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
286
283
|
s.specification_version = 3
|
287
284
|
|
288
|
-
if Gem::Version.new(Gem::
|
285
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
289
286
|
else
|
290
287
|
end
|
291
288
|
else
|
data/lib/gdata/client.rb
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# Copyright (C) 2008 Google Inc.
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
16
|
+
module GData
|
17
|
+
module Client
|
18
|
+
|
19
|
+
# Client class to wrap working with the Analytics API.
|
20
|
+
class Analytics < Base
|
21
|
+
|
22
|
+
def initialize(options = {})
|
23
|
+
options[:clientlogin_service] ||= 'analytics'
|
24
|
+
options[:authsub_scope] ||= 'https://www.google.com/analytics/feeds/'
|
25
|
+
super(options)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/gdata/client/base.rb
CHANGED
@@ -50,10 +50,10 @@ module GData
|
|
50
50
|
|
51
51
|
# Sends an HTTP request with the given file as a stream
|
52
52
|
def make_file_request(method, url, file_path, mime_type, entry = nil)
|
53
|
-
if not File.readable?(file_path)
|
53
|
+
if not File.readable?(open(file_path))
|
54
54
|
raise ArgumentError, "File #{file_path} is not readable."
|
55
55
|
end
|
56
|
-
file = File.open(file_path, 'rb')
|
56
|
+
file = File.open(open(file_path), 'rb')
|
57
57
|
@headers['Slug'] = File.basename(file_path)
|
58
58
|
if entry
|
59
59
|
@headers['MIME-Version'] = '1.0'
|
@@ -29,7 +29,8 @@ module GData
|
|
29
29
|
# GData::HTTP::Response object.
|
30
30
|
def make_request(request)
|
31
31
|
url = URI.parse(request.url)
|
32
|
-
|
32
|
+
proxy = URI::parse((url.scheme == 'https' ? ENV['https_proxy'] : ENV['http_proxy']) || '')
|
33
|
+
http = Net::HTTP.new(url.host, url.port, proxy.host, proxy.port)
|
33
34
|
http.use_ssl = (url.scheme == 'https')
|
34
35
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
35
36
|
|
Binary file
|
@@ -30,7 +30,10 @@ class TC_GData_HTTP_Request < Test::Unit::TestCase
|
|
30
30
|
|
31
31
|
response = service.make_request(request)
|
32
32
|
|
33
|
-
|
33
|
+
# Google responds with 302 temporary redirect if
|
34
|
+
# client IP address is not in the US
|
35
|
+
# http://www.google.com/support/websearch/bin/answer.py?answer=873
|
36
|
+
assert [200, 302].include?(response.status_code)
|
34
37
|
end
|
35
38
|
|
36
39
|
end
|
data/test/test_helper.rb
CHANGED
@@ -13,8 +13,15 @@
|
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
15
|
require 'yaml'
|
16
|
-
|
17
|
-
|
16
|
+
|
17
|
+
# Test::Unit is no longer in standard lib
|
18
|
+
if RUBY_VERSION >= '1.9.1'
|
19
|
+
require 'rubygems'
|
20
|
+
require 'test/unit' # gem install test-unit
|
21
|
+
else
|
22
|
+
require 'test/unit'
|
23
|
+
require 'test/unit/ui/console/testrunner'
|
24
|
+
end
|
18
25
|
|
19
26
|
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
20
27
|
require 'gdata'
|
data/test/ts_gdata.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 1.1.
|
8
|
+
- 5
|
9
|
+
version: 1.1.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jeff Fisher
|
@@ -14,13 +14,11 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2012-04-06 00:00:00 +01:00
|
18
18
|
default_executable: test_captcha.rb
|
19
19
|
dependencies: []
|
20
20
|
|
21
|
-
description:
|
22
|
-
This gem provides a set of wrappers designed to make it easy to work with
|
23
|
-
the Google Data APIs with 1.9 compat
|
21
|
+
description: Ruby 1.9.x compatible Google GData gem makes it easy to work with the Google Data APIs
|
24
22
|
email: jfisher@youtube.com
|
25
23
|
executables:
|
26
24
|
- test_captcha.rb
|
@@ -28,11 +26,11 @@ extensions: []
|
|
28
26
|
|
29
27
|
extra_rdoc_files:
|
30
28
|
- LICENSE
|
31
|
-
- README
|
29
|
+
- README.mdown
|
32
30
|
files:
|
33
31
|
- .hgtags
|
34
32
|
- LICENSE
|
35
|
-
- README
|
33
|
+
- README.mdown
|
36
34
|
- Rakefile
|
37
35
|
- VERSION
|
38
36
|
- bin/test_captcha.rb
|
@@ -244,6 +242,7 @@ files:
|
|
244
242
|
- lib/gdata/auth/authsub.rb
|
245
243
|
- lib/gdata/auth/clientlogin.rb
|
246
244
|
- lib/gdata/client.rb
|
245
|
+
- lib/gdata/client/analytics.rb
|
247
246
|
- lib/gdata/client/apps.rb
|
248
247
|
- lib/gdata/client/base.rb
|
249
248
|
- lib/gdata/client/blogger.rb
|
@@ -266,6 +265,7 @@ files:
|
|
266
265
|
- lib/gdata/http/request.rb
|
267
266
|
- lib/gdata/http/response.rb
|
268
267
|
- pkg/gdata_19-1.1.2.gem
|
268
|
+
- pkg/gdata_19-1.1.3.gem
|
269
269
|
- test/tc_gdata_auth_authsub.rb
|
270
270
|
- test/tc_gdata_auth_clientlogin.rb
|
271
271
|
- test/tc_gdata_client_base.rb
|
@@ -286,8 +286,8 @@ homepage: http://github.com/tokumine/GData
|
|
286
286
|
licenses: []
|
287
287
|
|
288
288
|
post_install_message:
|
289
|
-
rdoc_options:
|
290
|
-
|
289
|
+
rdoc_options: []
|
290
|
+
|
291
291
|
require_paths:
|
292
292
|
- lib
|
293
293
|
required_ruby_version: !ruby/object:Gem::Requirement
|
data/README
DELETED
@@ -1,97 +0,0 @@
|
|
1
|
-
= GData
|
2
|
-
|
3
|
-
* http://code.google.com/p/gdata
|
4
|
-
|
5
|
-
== DESCRIPTION:
|
6
|
-
|
7
|
-
Ruby wrapper for working with Google Data APIs
|
8
|
-
|
9
|
-
== SYNOPSIS:
|
10
|
-
|
11
|
-
yt = GData::Client::YouTube.new
|
12
|
-
yt.source = 'my_cool_application'
|
13
|
-
yt.clientlogin('username', 'password')
|
14
|
-
yt.client_id = 'CLIENT_ID'
|
15
|
-
yt.developer_key = 'DEVELOPER_KEY'
|
16
|
-
feed = yt.get('http://gdata.youtube.com/feeds/api/users/default/uploads').to_xml
|
17
|
-
|
18
|
-
# creating, updating, and deleting a playlist
|
19
|
-
|
20
|
-
entry = <<-EOF
|
21
|
-
<entry xmlns="http://www.w3.org/2005/Atom"
|
22
|
-
xmlns:yt="http://gdata.youtube.com/schemas/2007">
|
23
|
-
<title type="text">Ruby Utility Unit Test</title>
|
24
|
-
<summary>This is a test playlist.</summary>
|
25
|
-
</entry>
|
26
|
-
EOF
|
27
|
-
|
28
|
-
response = yt.post('http://gdata.youtube.com/feeds/api/users/default/playlists', entry).to_xml
|
29
|
-
|
30
|
-
edit_uri = response.elements["link[@rel='edit']"].attributes['href']
|
31
|
-
|
32
|
-
response.elements["summary"].text = "Updated description"
|
33
|
-
|
34
|
-
response = yt.put(edit_uri, response.to_s).to_xml
|
35
|
-
|
36
|
-
yt.delete(edit_uri).to_xml
|
37
|
-
|
38
|
-
# uploading a video
|
39
|
-
|
40
|
-
test_movie = '/path/to/a/movie.mov'
|
41
|
-
mime_type = 'video/quicktime'
|
42
|
-
feed = 'http://uploads.gdata.youtube.com/feeds/api/users/default/uploads'
|
43
|
-
|
44
|
-
entry = <<EOF
|
45
|
-
<entry xmlns="http://www.w3.org/2005/Atom"
|
46
|
-
xmlns:media="http://search.yahoo.com/mrss/"
|
47
|
-
xmlns:yt="http://gdata.youtube.com/schemas/2007">
|
48
|
-
<media:group>
|
49
|
-
<media:title type="plain">Test Movie</media:title>
|
50
|
-
<media:description type="plain">
|
51
|
-
This is a test with the Ruby library
|
52
|
-
</media:description>
|
53
|
-
<media:category
|
54
|
-
scheme="http://gdata.youtube.com/schemas/2007/categories.cat">People
|
55
|
-
</media:category>
|
56
|
-
<media:keywords>test,lame</media:keywords>
|
57
|
-
</media:group>
|
58
|
-
</entry>
|
59
|
-
EOF
|
60
|
-
|
61
|
-
response = @yt.post_file(feed, test_movie, mime_type, entry).to_xml
|
62
|
-
|
63
|
-
== REQUIREMENTS:
|
64
|
-
|
65
|
-
* A sunny disposition
|
66
|
-
|
67
|
-
Tested against Ruby 1.8.6 patch level 114
|
68
|
-
|
69
|
-
== INSTALL:
|
70
|
-
|
71
|
-
sudo gem install gdata_19
|
72
|
-
|
73
|
-
To generate documentation:
|
74
|
-
|
75
|
-
rake doc
|
76
|
-
|
77
|
-
To run unit tests:
|
78
|
-
|
79
|
-
cp test/test_config.yml.example test/test_config.yml
|
80
|
-
# edit test/test_config.yml
|
81
|
-
rake test
|
82
|
-
|
83
|
-
== LICENSE:
|
84
|
-
|
85
|
-
Copyright (C) 2008 Google Inc.
|
86
|
-
|
87
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
88
|
-
you may not use this file except in compliance with the License.
|
89
|
-
You may obtain a copy of the License at
|
90
|
-
|
91
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
92
|
-
|
93
|
-
Unless required by applicable law or agreed to in writing, software
|
94
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
95
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
96
|
-
See the License for the specific language governing permissions and
|
97
|
-
limitations under the License.
|