youtube_it 1.2.6 → 1.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/youtube_it/client.rb +1 -1
- data/lib/youtube_it/parser.rb +18 -19
- data/pkg/youtube_it-1.2.6.gem +0 -0
- data/youtube_it.gemspec +3 -2
- metadata +4 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.7
|
data/lib/youtube_it/client.rb
CHANGED
@@ -70,7 +70,7 @@ class YouTubeIt
|
|
70
70
|
request = YouTubeIt::Request::StandardSearch.new(params, request_params)
|
71
71
|
end
|
72
72
|
|
73
|
-
logger.debug "Submitting request [url=#{request.url}]."
|
73
|
+
logger.debug "Submitting request [url=#{request.url}]." if @legacy_debug_flag
|
74
74
|
parser = YouTubeIt::Parser::VideosFeedParser.new(request.url)
|
75
75
|
parser.parse
|
76
76
|
end
|
data/lib/youtube_it/parser.rb
CHANGED
@@ -204,30 +204,29 @@ class YouTubeIt
|
|
204
204
|
|
205
205
|
private
|
206
206
|
def parse_content(content)
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
207
|
+
videos = []
|
208
|
+
doc = REXML::Document.new(content)
|
209
|
+
feed = doc.elements["feed"]
|
210
|
+
if feed
|
211
|
+
feed_id = feed.elements["id"].text
|
212
|
+
updated_at = Time.parse(feed.elements["updated"].text)
|
213
|
+
total_result_count = feed.elements["openSearch:totalResults"].text.to_i
|
214
|
+
offset = feed.elements["openSearch:startIndex"].text.to_i
|
215
|
+
max_result_count = feed.elements["openSearch:itemsPerPage"].text.to_i
|
216
|
+
|
217
|
+
feed.elements.each("entry") do |entry|
|
218
|
+
videos << parse_entry(entry)
|
219
|
+
end
|
219
220
|
end
|
220
|
-
|
221
221
|
YouTubeIt::Response::VideoSearch.new(
|
222
|
-
:feed_id => feed_id,
|
223
|
-
:updated_at => updated_at,
|
224
|
-
:total_result_count => total_result_count,
|
225
|
-
:offset => offset,
|
226
|
-
:max_result_count => max_result_count,
|
222
|
+
:feed_id => feed_id || nil,
|
223
|
+
:updated_at => updated_at || nil,
|
224
|
+
:total_result_count => total_result_count || nil,
|
225
|
+
:offset => offset || nil,
|
226
|
+
:max_result_count => max_result_count || nil,
|
227
227
|
:videos => videos)
|
228
228
|
end
|
229
229
|
end
|
230
|
-
|
231
230
|
end
|
232
231
|
end
|
233
232
|
|
Binary file
|
data/youtube_it.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{youtube_it}
|
8
|
-
s.version = "1.2.
|
8
|
+
s.version = "1.2.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["chebyte", "kylejginavan"]
|
12
|
-
s.date = %q{2011-02-
|
12
|
+
s.date = %q{2011-02-02}
|
13
13
|
s.description = %q{Upload, delete, update, comment on youtube videos all from one gem.}
|
14
14
|
s.email = %q{kylejginavan@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -51,6 +51,7 @@ Gem::Specification.new do |s|
|
|
51
51
|
"pkg/youtube_it-1.2.3.gem",
|
52
52
|
"pkg/youtube_it-1.2.4.gem",
|
53
53
|
"pkg/youtube_it-1.2.5.gem",
|
54
|
+
"pkg/youtube_it-1.2.6.gem",
|
54
55
|
"test/helper.rb",
|
55
56
|
"test/test.mov",
|
56
57
|
"test/test_chain_io.rb",
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 1.2.
|
8
|
+
- 7
|
9
|
+
version: 1.2.7
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- chebyte
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-02 00:00:00 -06:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -90,6 +90,7 @@ files:
|
|
90
90
|
- pkg/youtube_it-1.2.3.gem
|
91
91
|
- pkg/youtube_it-1.2.4.gem
|
92
92
|
- pkg/youtube_it-1.2.5.gem
|
93
|
+
- pkg/youtube_it-1.2.6.gem
|
93
94
|
- test/helper.rb
|
94
95
|
- test/test.mov
|
95
96
|
- test/test_chain_io.rb
|