punndit_youtube 0.0.9.2 → 0.0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/punndit_youtube/parser.rb +5 -5
- data/lib/punndit_youtube/version.rb +1 -1
- data/spec/punndit_youtube_spec.rb +12 -4
- metadata +2 -2
@@ -15,20 +15,20 @@ module PunnditYoutube
|
|
15
15
|
def parse_content(response)
|
16
16
|
json_body = JSON.parse(response.body)
|
17
17
|
e = json_body['entry']
|
18
|
-
|
18
|
+
puts "e: #{e['gd$comments']}"
|
19
19
|
video = PunnditYoutube::Model::Video.new(
|
20
20
|
:id => e['media$group']['yt$videoid']['$t'],
|
21
21
|
:title => e['title']['$t'],
|
22
22
|
:description => e['media$group']['media$description']['$t'],
|
23
|
-
|
23
|
+
###:comment_url => e['gd$comments']['gd$feedLink']['href'],
|
24
24
|
:video_url => e['media$group']['media$player']['url'],
|
25
|
-
|
25
|
+
###:keywords => e['mediage$group']['media$keywords']['$t'], if e['mediage$group']['media$keywords']['$t']
|
26
26
|
:thumbnails => e['media$group']['media$thumbnail'],
|
27
|
-
|
27
|
+
###:aspect_ratio => e['media$group']['yt$aspectRatio']['$t'], if e['media$group']['yt$aspectRatio']['$t']
|
28
28
|
:duration => e['media$group']['yt$duration']['seconds'],
|
29
29
|
:uploaded => e['media$group']['yt$uploaded']['$t'],
|
30
30
|
:uploader_id => e['media$group']['yt$uploaderId']['$t'],
|
31
|
-
|
31
|
+
#:stats => {:favorites => e['yt$statistics']['favoriteCount'], :view_count => e['yt$statistics']['viewCount'], :likes => e['yt$rating']['numLikes'], :dislikes => e['yt$rating']['numDislikes'], :average => e['gd$rating']['average'], :max => e['gd$rating']['max'], :min => e['gd$rating']['min'], :numRaters => e['gd$rating']['numRaters'], :rel => e['gd$rating']['rel']},
|
32
32
|
:updated_at => e['updated']['$t']
|
33
33
|
)
|
34
34
|
end
|
@@ -3,13 +3,13 @@ require 'spec_helper'
|
|
3
3
|
describe PunnditYoutube do
|
4
4
|
it "should find single video information" do
|
5
5
|
client = TestClient.new
|
6
|
-
video = client.should_find_video("
|
6
|
+
video = client.should_find_video("n09ZHecJnu4")
|
7
7
|
video.title.should_not be_empty
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should find playlist information" do
|
11
11
|
client = TestClient.new
|
12
|
-
playlist = client.should_find_playlist("
|
12
|
+
playlist = client.should_find_playlist("PLB24w3SKRHF9xdgKOmW_D488sTUI4qlqN")
|
13
13
|
playlist.title.should_not be_empty
|
14
14
|
end
|
15
15
|
|
@@ -25,12 +25,20 @@ describe PunnditYoutube do
|
|
25
25
|
user.videos.should_not be_empty
|
26
26
|
end
|
27
27
|
|
28
|
+
it "should create video for channel" do
|
29
|
+
client = TestClient.new
|
30
|
+
user = client.should_find_channel_for_user("punndit")
|
31
|
+
#puts "videos: count: #{user.videos.count}"
|
32
|
+
user.videos.each do |v|
|
33
|
+
#puts v.to_json
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
28
37
|
it "should find playlist information for all playlists" do
|
29
38
|
client = PunnditYoutube::Client.new
|
30
|
-
user = client.get_playlists("
|
39
|
+
user = client.get_playlists("randallsstevens")
|
31
40
|
|
32
41
|
user.playlists.each do |p|
|
33
|
-
puts p.id
|
34
42
|
playlist = client.playlist(p.id)
|
35
43
|
playlist.title.should_not be_empty
|
36
44
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: punndit_youtube
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.9.
|
4
|
+
version: 0.0.9.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|