downthetube 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -10,30 +10,53 @@ gem 'downthetube'
10
10
 
11
11
  Usage:
12
12
 
13
+ In irb you need to do the requires:
14
+ require 'rubygems'
15
+ require 'downthetube'
13
16
 
14
- irb(main):006:0> playlist = Youtube.playlists_for("stephensam").first
15
- => #<Youtube::Playlist:0x7fae33fc06a0 @author="stephensam", @title="Capoeira Angola", @url="http://gdata.youtube.com/feeds/api/playlists/76E01802262A6694", @id="76E01802262A6694", @xml=<entry gd:etag='W/&quot;CUQGR347eCp7ImA9WhZVGEk.&quot;'> ... </>>
16
- irb(main):007:0> playlist.title
17
+ And then play. I've tried to make it do what you would expect:
18
+
19
+ irb(main):018:0> pl = Youtube::Playlist.new "76E01802262A6694"
20
+ => #<Youtube::Playlist:0x7ff91ce51f38 @url="http://gdata.youtube.com/feeds/api/playlists/76E01802262A6694">
21
+
22
+ irb(main):019:0> playlists = Youtube.playlists_for "stephensam"
23
+ => [#<Youtube::Playlist:0x7ff91ce214c8 @client=#<GData::Client::YouTube:0x7ff91ce1e9a8 @source="AnonymousApp", @http_service=GData::HTTP::DefaultService, @clientlogin_url="https://www.google.com/youtube/accounts/ClientLogin", @authsub_scope="http://gdata.youtube.com", @version="2", @headers={}, @clientlogin_service="youtube">, @url="http://gdata.youtube.com/feeds/api/playlists/76E01802262A6694", @author="stephensam", @xml=<entry gd:etag='W/&quot;CUQGR347eCp7ImA9WhZVGEk.&quot;'> ... </>, @title="Capoeira Angola", @id="76E01802262A6694">]
24
+
25
+ irb(main):021:0> playlists.first.title
17
26
  => "Capoeira Angola"
18
- irb(main):008:0> playlist.url
19
- => "http://gdata.youtube.com/feeds/api/playlists/76E01802262A6694"
20
- irb(main):009:0> playlist.videos(1)
21
- => [#<Youtube::Video:0x7fae340c4e98 @uploader="cdoucrania", @description="www.cdo.net.ua", @title="Mestre Jogo de Dentro on Capoerando 2010", @duration="218", @url="http://www.youtube.com/watch?v=aoBRfYkEH2w", @id="aoBRfYkEH2w", @small_thumbnail="http://i.ytimg.com/vi/aoBRfYkEH2w/default.jpg", @xml=<entry gd:etag='W/&quot;DUUMRX4_eip7ImA9WhZVGEU.&quot;'> ... </>, @large_thumbnail="http://i.ytimg.com/vi/aoBRfYkEH2w/hqdefault.jpg">]
22
- irb(main):010:0> video = playlist.videos(1)
23
- => [#<Youtube::Video:0x7fae340c4e98 @uploader="cdoucrania", @description="www.cdo.net.ua", @title="Mestre Jogo de Dentro on Capoerando 2010", @duration="218", @url="http://www.youtube.com/watch?v=aoBRfYkEH2w", @id="aoBRfYkEH2w", @small_thumbnail="http://i.ytimg.com/vi/aoBRfYkEH2w/default.jpg", @xml=<entry gd:etag='W/&quot;DUUMRX4_eip7ImA9WhZVGEU.&quot;'> ... </>, @large_thumbnail="http://i.ytimg.com/vi/aoBRfYkEH2w/hqdefault.jpg">]
24
- irb(main):012:0> video = playlist.videos(1).first
25
- => #<Youtube::Video:0x7fae340c4e98 @uploader="cdoucrania", @description="www.cdo.net.ua", @title="Mestre Jogo de Dentro on Capoerando 2010", @duration="218", @url="http://www.youtube.com/watch?v=aoBRfYkEH2w", @id="aoBRfYkEH2w", @small_thumbnail="http://i.ytimg.com/vi/aoBRfYkEH2w/default.jpg", @xml=<entry gd:etag='W/&quot;DUUMRX4_eip7ImA9WhZVGEU.&quot;'> ... </>, @large_thumbnail="http://i.ytimg.com/vi/aoBRfYkEH2w/hqdefault.jpg">
26
- irb(main):013:0> video.title
27
- => "Mestre Jogo de Dentro on Capoerando 2010"
28
- irb(main):014:0> video.description
29
- => "www.cdo.net.ua"
30
- irb(main):015:0> video.thumbnail(:large)
31
- => "http://i.ytimg.com/vi/aoBRfYkEH2w/hqdefault.jpg"
32
- irb(main):016:0> video.thumbnail
33
- => "http://i.ytimg.com/vi/aoBRfYkEH2w/default.jpg"
34
- irb(main):017:0> video.url
35
- => "http://www.youtube.com/watch?v=aoBRfYkEH2w"
36
- irb(main):018:0>
27
+
28
+ irb(main):022:0> playlists.class
29
+ => Array
30
+
31
+ irb(main):023:0> vids = playlists.first.videos 2
32
+ => [#<Youtube::Video:0x7ff91cf63098 @xml=<entry gd:etag='W/&quot;AkQDQ3s-fCp7ImA9WhZUEkk.&quot;'> ... </>>, #<Youtube::Video:0x7ff91cf59bd8 @xml=<entry gd:etag='W/&quot;AkQDQ3s-fCp7ImA9WhZUEkk.&quot;'> ... </>>]
33
+
34
+ irb(main):024:0> vid = vids.last
35
+ => #<Youtube::Video:0x7ff91cf59bd8 @xml=<entry gd:etag='W/&quot;AkQDQ3s-fCp7ImA9WhZUEkk.&quot;'> ... </>>
36
+
37
+ irb(main):025:0> vid.title
38
+ => "Mestre Jogo De Dentro e Mestra Tisza,Ilheus 2008"
39
+
40
+ irb(main):026:0> vid.description
41
+ => "Roda de fim de ano na praca de Ilheus 2008,gravado por CM Denis."
42
+
43
+ irb(main):027:0> vid.url
44
+ => "http://www.youtube.com/watch?v=4I_4JgV-y8s"
45
+
46
+ irb(main):028:0> vid.thumbnail :large
47
+ => "http://i.ytimg.com/vi/4I_4JgV-y8s/hqdefault.jpg"
48
+
49
+ irb(main):029:0> itapua = Youtube::Video.new "5Pg6a3TbF68"
50
+ => #<Youtube::Video:0x7ff91cf097a0 @url="http://gdata.youtube.com/feeds/api/videos/5Pg6a3TbF68?v=2">
51
+
52
+ irb(main):030:0> itapua.thumbnail
53
+ => "http://i.ytimg.com/vi/5Pg6a3TbF68/default.jpg"
54
+
55
+ irb(main):031:0> itapua.title
56
+ => "Itapuã e Gibi - Roda Lavradio"
57
+
58
+ irb(main):032:0> itapua.url
59
+ => "http://www.youtube.com/watch?v=5Pg6a3TbF68"
37
60
 
38
61
 
39
62
  LICENSE:
data/downthetube.gemspec CHANGED
@@ -1,14 +1,14 @@
1
1
  specification = Gem::Specification.new do |spec|
2
2
  # Descriptive and source information for this gem.
3
3
  spec.name = "downthetube"
4
- spec.version = "0.0.3"
4
+ spec.version = "0.0.5"
5
5
  spec.description = "A library to make downloading playlists and videos from Youtube less nasty."
6
6
  spec.summary = "Downloads playlists and videos from Youtube."
7
7
  spec.author = "Mike Williamson"
8
8
  spec.email = "blessedbyvirtuosity@gmail.com"
9
9
  spec.homepage = ""
10
10
  require 'rake'
11
- spec.files = %w(README lib/downthetube/youtube.rb lib/downthetube/video.rb lib/downthetube/play_list.rb downthetube.gemspec)
11
+ spec.files = %w(README lib/downthetube.rb lib/youtube.rb lib/video.rb lib/play_list.rb downthetube.gemspec)
12
12
  spec.has_rdoc = false
13
13
  spec.add_dependency("gdata", ">= 1.0.0")
14
14
  spec.extra_rdoc_files = ["README"]
@@ -0,0 +1,3 @@
1
+ require 'youtube'
2
+ require 'play_list'
3
+ require 'video'
@@ -49,7 +49,7 @@ module Youtube
49
49
  end
50
50
  end
51
51
  EOM
52
- class_eval method_def
52
+ Playlist.class_eval method_def
53
53
  end
54
54
  end
55
55
 
@@ -35,7 +35,7 @@ module Youtube
35
35
  end
36
36
  end
37
37
  EOM
38
- class_eval method_def
38
+ Video.class_eval method_def
39
39
  end
40
40
  end
41
41
 
@@ -1,7 +1,7 @@
1
1
  module Youtube
2
2
  require 'rubygems'
3
3
  require 'gdata'
4
-
4
+ require 'rexml/document'
5
5
  def Youtube.playlists_for user
6
6
  @client = GData::Client::YouTube.new
7
7
  feed = @client.get("http://gdata.youtube.com/feeds/api/users/#{user}/playlists?v=2").to_xml
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: downthetube
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mike Williamson
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-04 00:00:00 -04:00
18
+ date: 2011-06-05 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -44,9 +44,10 @@ extra_rdoc_files:
44
44
  - README
45
45
  files:
46
46
  - README
47
- - lib/downthetube/youtube.rb
48
- - lib/downthetube/video.rb
49
- - lib/downthetube/play_list.rb
47
+ - lib/downthetube.rb
48
+ - lib/youtube.rb
49
+ - lib/video.rb
50
+ - lib/play_list.rb
50
51
  - downthetube.gemspec
51
52
  has_rdoc: true
52
53
  homepage: ""