youtube_it 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.0
1
+ 1.3.1
@@ -159,7 +159,7 @@ class YouTubeIt
159
159
  }
160
160
 
161
161
  if extended_rating_element
162
- rating_values[:likes] = extended_rating_element.attributes["numLikes"].to_i,
162
+ rating_values[:likes] = extended_rating_element.attributes["numLikes"].to_i
163
163
  rating_values[:dislikes] = extended_rating_element.attributes["numDislikes"].to_i
164
164
  end
165
165
 
@@ -0,0 +1,53 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <entry xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:gd="http://schemas.google.com/g/2005" xmlns:yt="http://gdata.youtube.com/schemas/2007" gd:etag="W/&quot;A0UBR347eCp7ImA9Wx9bFEs.&quot;">
3
+ <id>tag:youtube.com,2008:video:TESTVIDEO</id>
4
+ <published>2010-12-29T13:57:49.000Z</published>
5
+ <updated>2011-02-23T13:54:16.000Z</updated>
6
+ <category scheme="http://schemas.google.com/g/2005#kind" term="http://gdata.youtube.com/schemas/2007#video"/>
7
+ <category scheme="http://gdata.youtube.com/schemas/2007/categories.cat" term="Test" label="Test"/>
8
+ <category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="test"/>
9
+ <title>YouTube Test Video</title>
10
+ <content type="application/x-shockwave-flash" src="http://www.youtube.com/v/YTTESTVIDEO?f=videos&amp;app=youtube_gdata"/>
11
+ <link rel="alternate" type="text/html" href="http://www.youtube.com/watch?v=YTTESTVIDEO&amp;feature=youtube_gdata"/>
12
+ <link rel="http://gdata.youtube.com/schemas/2007#video.responses" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/YTTESTVIDEO/responses?v=2"/>
13
+ <link rel="http://gdata.youtube.com/schemas/2007#video.related" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/YTTESTVIDEO/related?v=2"/>
14
+ <link rel="http://gdata.youtube.com/schemas/2007#mobile" type="text/html" href="http://m.youtube.com/details?v=YTTESTVIDEO"/>
15
+ <link rel="self" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/YTTESTVIDEO?v=2"/>
16
+ <author>
17
+ <name>Test user</name>
18
+ <uri>http://gdata.youtube.com/feeds/api/users/test_user</uri>
19
+ </author>
20
+ <yt:accessControl action="comment" permission="allowed"/>
21
+ <yt:accessControl action="commentVote" permission="allowed"/>
22
+ <yt:accessControl action="videoRespond" permission="moderated"/>
23
+ <yt:accessControl action="rate" permission="allowed"/>
24
+ <yt:accessControl action="embed" permission="allowed"/>
25
+ <yt:accessControl action="list" permission="allowed"/>
26
+ <yt:accessControl action="syndicate" permission="allowed"/>
27
+ <gd:comments>
28
+ <gd:feedLink href="http://gdata.youtube.com/feeds/api/videos/YTTESTVIDEO/comments?v=2" countHint="1000"/>
29
+ </gd:comments>
30
+ <media:group>
31
+ <media:category label="Sports" scheme="http://gdata.youtube.com/schemas/2007/categories.cat">Test</media:category>
32
+ <media:content url="http://www.youtube.com/v/YTTESTVIDEO?f=videos&amp;app=youtube_gdata" type="application/x-shockwave-flash" medium="video" isDefault="true" expression="full" duration="356" yt:format="5"/>
33
+ <media:content url="rtsp://v7.cache6.c.youtube.com/YTTESTCACHE/0/0/0/video.3gp" type="video/3gpp" medium="video" expression="full" duration="356" yt:format="1"/>
34
+ <media:content url="rtsp://v8.cache7.c.youtube.com/YTTESTCACHE/0/0/0/video.3gp" type="video/3gpp" medium="video" expression="full" duration="356" yt:format="6"/>
35
+ <media:credit role="uploader" scheme="urn:youtube" yt:type="partner">Test user</media:credit>
36
+ <media:description type="plain">Youtube Test Video</media:description>
37
+ <media:keywords>Test, Youtube, Youtube_it, Ruby</media:keywords>
38
+ <media:player url="http://www.youtube.com/watch?v=YTTESTVIDEO&amp;feature=youtube_gdata_player"/>
39
+ <media:thumbnail url="http://i.ytimg.com/vi/YTTESTVIDEO/default.jpg" height="90" width="120" time="00:02:58" yt:name="default"/>
40
+ <media:thumbnail url="http://i.ytimg.com/vi/YTTESTVIDEO/hqdefault.jpg" height="360" width="480" yt:name="hqdefault"/>
41
+ <media:thumbnail url="http://i.ytimg.com/vi/YTTESTVIDEO/1.jpg" height="90" width="120" time="00:01:29" yt:name="start"/>
42
+ <media:thumbnail url="http://i.ytimg.com/vi/YTTESTVIDEO/2.jpg" height="90" width="120" time="00:02:58" yt:name="middle"/>
43
+ <media:thumbnail url="http://i.ytimg.com/vi/YTTESTVIDEO/3.jpg" height="90" width="120" time="00:04:27" yt:name="end"/>
44
+ <media:title type="plain">Ich sterbe für YouTube</media:title>
45
+ <yt:aspectRatio>widescreen</yt:aspectRatio>
46
+ <yt:duration seconds="356"/>
47
+ <yt:uploaded>2010-12-29T13:57:49.000Z</yt:uploaded>
48
+ <yt:videoid>YTTESTVIDEO</yt:videoid>
49
+ </media:group>
50
+ <gd:rating average="4.305027" max="5" min="1" numRaters="2049" rel="http://schemas.google.com/g/2005#overall"/>
51
+ <yt:statistics favoriteCount="200" viewCount="240000"/>
52
+ <yt:rating numDislikes="350" numLikes="1700"/>
53
+ </entry>
@@ -0,0 +1,24 @@
1
+ require File.dirname(__FILE__) + '/helper'
2
+
3
+ class TestVideoFeedParser < Test::Unit::TestCase
4
+ def test_should_parse_likes_correctly
5
+ with_video_response do |parser|
6
+ video = parser.parse
7
+ assert_equal 1700, video.rating.likes
8
+ end
9
+ end
10
+
11
+ def test_should_parse_dislikes_correctly
12
+ with_video_response do |parser|
13
+ video = parser.parse
14
+ assert_equal 350, video.rating.dislikes
15
+ end
16
+ end
17
+
18
+ def with_video_response &block
19
+ File.open(File.dirname(__FILE__) + '/files/youtube_video_response.xml') do |xml|
20
+ parser = YouTubeIt::Parser::VideoFeedParser.new xml.read
21
+ yield parser
22
+ end
23
+ end
24
+ end
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.3.0"
8
+ s.version = "1.3.1"
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-22}
12
+ s.date = %q{2011-02-23}
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 = [
@@ -43,11 +43,13 @@ Gem::Specification.new do |s|
43
43
  "lib/youtube_it/request/video_upload.rb",
44
44
  "lib/youtube_it/response/video_search.rb",
45
45
  "lib/youtube_it/version.rb",
46
+ "test/files/youtube_video_response.xml",
46
47
  "test/helper.rb",
47
48
  "test/test.mov",
48
49
  "test/test_chain_io.rb",
49
50
  "test/test_client.rb",
50
51
  "test/test_video.rb",
52
+ "test/test_video_feed_parser.rb",
51
53
  "test/test_video_search.rb",
52
54
  "youtube_it.gemspec"
53
55
  ]
@@ -60,6 +62,7 @@ Gem::Specification.new do |s|
60
62
  "test/test_chain_io.rb",
61
63
  "test/test_client.rb",
62
64
  "test/test_video.rb",
65
+ "test/test_video_feed_parser.rb",
63
66
  "test/test_video_search.rb"
64
67
  ]
65
68
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: youtube_it
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.3.0
5
+ version: 1.3.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - chebyte
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-02-22 00:00:00 -06:00
14
+ date: 2011-02-23 00:00:00 -06:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
@@ -72,11 +72,13 @@ files:
72
72
  - lib/youtube_it/request/video_upload.rb
73
73
  - lib/youtube_it/response/video_search.rb
74
74
  - lib/youtube_it/version.rb
75
+ - test/files/youtube_video_response.xml
75
76
  - test/helper.rb
76
77
  - test/test.mov
77
78
  - test/test_chain_io.rb
78
79
  - test/test_client.rb
79
80
  - test/test_video.rb
81
+ - test/test_video_feed_parser.rb
80
82
  - test/test_video_search.rb
81
83
  - youtube_it.gemspec
82
84
  has_rdoc: true
@@ -112,4 +114,5 @@ test_files:
112
114
  - test/test_chain_io.rb
113
115
  - test/test_client.rb
114
116
  - test/test_video.rb
117
+ - test/test_video_feed_parser.rb
115
118
  - test/test_video_search.rb