youtube-g 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ == 0.4.1 / 2008-02-11
2
+
3
+ * Added 3GPP video format [shane]
4
+ * Fixed tests [shane]
5
+
1
6
  == 0.4.0 / 2007-12-18
2
7
 
3
8
  * Fixed API projection in search URL [Pete Higgins]
data/README.txt CHANGED
@@ -3,32 +3,46 @@ youtube-g
3
3
  http://rubyforge.org/projects/youtube-g/
4
4
 
5
5
  == DESCRIPTION:
6
-
7
- youtube-g is a pure Ruby client for the YouTube GData API.
6
+
7
+ youtube-g is a pure Ruby client for the YouTube GData API. It provides an easy
8
+ way to access the latest YouTube video search results from your own programs.
9
+ In comparison with the earlier Youtube search interfaces, this new API and
10
+ library offers much-improved flexibility around executing complex search
11
+ queries to obtain well-targeted video search results.
12
+
13
+ More detail on the underlying source Google-provided API is available at:
14
+
15
+ http://code.google.com/apis/youtube/overview.html
8
16
 
9
17
  == FEATURES/PROBLEMS:
10
18
 
11
- * Aims to be in parity with Google's YouTube GData API (it is currently not complete)
19
+ * Aims to be in parity with Google's YouTube GData API. Core functionality
20
+ is currently present -- work is in progress to fill in the rest.
12
21
 
13
22
  == SYNOPSIS:
14
23
 
15
- Basic queries:
16
-
17
- @client = YouTubeG::Client.new
18
- @client.videos_by(:query => "penguin")
19
- @client.videos_by(:tags => ['tiger', 'leopard'])
20
- @client.videos_by(:categories => [:news, :sports])
21
- @client.videos_by(:categories => [:news, :sports], :tags => ['soccer', 'football'])
22
- @client.videos_by(:user => 'liz')
24
+ Create a client:
25
+
26
+ require 'rubygems'
27
+ require 'youtube_g'
28
+ client = YouTubeG::Client.new
29
+
30
+ Basic queries:
31
+
32
+ client.videos_by(:query => "penguin")
33
+ client.videos_by(:tags => ['tiger', 'leopard'])
34
+ client.videos_by(:categories => [:news, :sports])
35
+ client.videos_by(:categories => [:news, :sports], :tags => ['soccer', 'football'])
36
+ client.videos_by(:user => 'liz')
23
37
 
24
- Standard feeds:
38
+ Standard feeds:
25
39
 
26
- @client.videos_by(:most_viewed)
27
- @client.videos_by(:top_rated, :time => :today)
40
+ client.videos_by(:most_viewed)
41
+ client.videos_by(:top_rated, :time => :today)
28
42
 
29
- Advanced queries (with boolean operators OR (either), AND (include), NOT (exclude)):
43
+ Advanced queries (with boolean operators OR (either), AND (include), NOT (exclude)):
30
44
 
31
- @client.videos_by(:categories => { :either => [:news, :sports], :exclude => [:comedy] }, :tags => { :include => ['football'], :exclude => ['soccer'] })
45
+ client.videos_by(:categories => { :either => [:news, :sports], :exclude => [:comedy] }, :tags => { :include => ['football'], :exclude => ['soccer'] })
32
46
 
33
47
 
34
48
  == REQUIREMENTS:
@@ -43,8 +57,7 @@ youtube-g is a pure Ruby client for the YouTube GData API.
43
57
 
44
58
  MIT License
45
59
 
46
- Copyright (c) 2007 Shane Vitarana
47
- Copyright (c) 2007 Walter Korman
60
+ Copyright (c) 2007 Shane Vitarana and Walter Korman
48
61
 
49
62
  Permission is hereby granted, free of charge, to any person obtaining
50
63
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -10,6 +10,7 @@ Hoe.new('youtube-g', YouTubeG::VERSION) do |p|
10
10
  p.description = p.paragraphs_of('README.txt', 2..8).join("\n\n")
11
11
  p.url = 'http://rubyforge.org/projects/youtube-g/'
12
12
  p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
13
+ p.remote_rdoc_dir = ''
13
14
  end
14
15
 
15
16
  desc 'Tag release'
data/TODO.txt CHANGED
@@ -1,7 +1,14 @@
1
- [ ] Tests with mocked out YouTube server
1
+ [ ] stub out http request/response cycle for tests
2
+ [ ] consider defaulting the client to no-logger, rather than outputting to STDOUT.
3
+ [ ] allow specifying values as single items where you don't need to wrap in a list, e.g. :tags => :chickens instead of :tags => [ 'chickens' ]
4
+ [ ] make sure symbols will work as well as tags everywhere (again, :tags => :chickens is same as :tags => 'chickens')
5
+ [ ] figure out better structure for class/file (either rename request/video_search.rb or split into one class per file again)
6
+ [ ] restore spaces after method def names
7
+ [ ] use a proxy for testing with static sample result xml so we have repeatable tests
2
8
  [ ] Clean up tests using Shoulda to define contexts
3
9
  [ ] Consolidate requires
4
10
  [ ] Allow :category and :categories for query DSL
11
+ [ ] Exception handling
5
12
 
6
13
  == API Features TODO
7
14
 
@@ -14,5 +14,5 @@ require File.dirname(__FILE__) + '/youtube_g/request/video_search'
14
14
  require File.dirname(__FILE__) + '/youtube_g/response/video_search'
15
15
 
16
16
  class YouTubeG
17
- VERSION = '0.4.0'
17
+ VERSION = '0.4.1'
18
18
  end
@@ -32,6 +32,8 @@ class YouTubeG
32
32
  # is not available for a video that is not embeddable.
33
33
  #
34
34
  SWF = YouTubeG::Model::Video::Format.new(5, :swf)
35
+
36
+ THREE_GPP = YouTubeG::Model::Video::Format.new(6, :three_gpp)
35
37
  end
36
38
 
37
39
  attr_reader :duration
@@ -12,9 +12,9 @@ class TestClient < Test::Unit::TestCase
12
12
  def test_should_respond_to_a_basic_query
13
13
  response = @client.videos_by(:query => "penguin")
14
14
 
15
- assert_equal "http://gdata.youtube.com/feeds/api/videos", response.feed_id
15
+ assert_equal "http://gdata.youtube.com/feeds/api/videos?start-index=1&max-results=25&vq=penguin", response.feed_id
16
16
  assert_equal 25, response.max_result_count
17
- assert_equal 24, response.videos.length
17
+ assert_equal 25, response.videos.length
18
18
  assert_equal 1, response.offset
19
19
  assert(response.total_result_count > 100)
20
20
  assert_instance_of Time, response.updated_at
@@ -25,7 +25,7 @@ class TestClient < Test::Unit::TestCase
25
25
  def test_should_get_videos_for_multiword_metasearch_query
26
26
  response = @client.videos_by(:query => 'christina ricci')
27
27
 
28
- assert_equal "http://gdata.youtube.com/feeds/api/videos", response.feed_id
28
+ assert_equal "http://gdata.youtube.com/feeds/api/videos?start-index=1&max-results=25&vq=christina+ricci", response.feed_id
29
29
  assert_equal 25, response.max_result_count
30
30
  assert_equal 25, response.videos.length
31
31
  assert_equal 1, response.offset
@@ -104,7 +104,7 @@ class TestClient < Test::Unit::TestCase
104
104
  def test_should_get_videos_for_query_search_with_categories_excluded
105
105
  response = @client.videos_by(:query => 'bench press', :categories => { :exclude => [:comedy, :entertainment] },
106
106
  :max_results => 10)
107
- assert_equal "<object width=\"425\" height=\"350\">\n <param name=\"movie\" value=\"http://www.youtube.com/v/wOnP_oAXUMA\"></param>\n <param name=\"wmode\" value=\"transparent\"></param>\n <embed src=\"http://www.youtube.com/v/wOnP_oAXUMA\" type=\"application/x-shockwave-flash\" \n wmode=\"transparent\" width=\"425\" height=\"350\"></embed>\n</object>\n", response.videos.first.embed_html
107
+ assert_equal "<object width=\"425\" height=\"350\">\n <param name=\"movie\" value=\"http://www.youtube.com/v/BlDWdfTAx8o\"></param>\n <param name=\"wmode\" value=\"transparent\"></param>\n <embed src=\"http://www.youtube.com/v/BlDWdfTAx8o\" type=\"application/x-shockwave-flash\" \n wmode=\"transparent\" width=\"425\" height=\"350\"></embed>\n</object>\n", response.videos.first.embed_html
108
108
  response.videos.each { |v| assert_valid_video v }
109
109
  end
110
110
 
metadata CHANGED
@@ -3,15 +3,15 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: youtube-g
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.4.0
7
- date: 2007-12-18 00:00:00 -06:00
6
+ version: 0.4.1
7
+ date: 2008-02-11 00:00:00 -06:00
8
8
  summary: Ruby client for the YouTube GData API
9
9
  require_paths:
10
10
  - lib
11
11
  email: shanev@gmail.com
12
12
  homepage: http://rubyforge.org/projects/youtube-g/
13
13
  rubyforge_project: youtube-g
14
- description: "== FEATURES/PROBLEMS: * Aims to be in parity with Google's YouTube GData API (it is currently not complete) == SYNOPSIS: Basic queries: @client = YouTubeG::Client.new @client.videos_by(:query => \"penguin\") @client.videos_by(:tags => ['tiger', 'leopard']) @client.videos_by(:categories => [:news, :sports]) @client.videos_by(:categories => [:news, :sports], :tags => ['soccer', 'football']) @client.videos_by(:user => 'liz') Standard feeds: @client.videos_by(:most_viewed) @client.videos_by(:top_rated, :time => :today) Advanced queries (with boolean operators OR (either), AND (include), NOT (exclude)): @client.videos_by(:categories => { :either => [:news, :sports], :exclude => [:comedy] }, :tags => { :include => ['football'], :exclude => ['soccer'] }) == REQUIREMENTS: * None == INSTALL: * sudo gem install youtube-g"
14
+ description: "youtube-g is a pure Ruby client for the YouTube GData API. It provides an easy way to access the latest YouTube video search results from your own programs. In comparison with the earlier Youtube search interfaces, this new API and library offers much-improved flexibility around executing complex search queries to obtain well-targeted video search results. More detail on the underlying source Google-provided API is available at: http://code.google.com/apis/youtube/overview.html == FEATURES/PROBLEMS: * Aims to be in parity with Google's YouTube GData API. Core functionality is currently present -- work is in progress to fill in the rest. == SYNOPSIS: Create a client: require 'rubygems' require 'youtube_g' client = YouTubeG::Client.new Basic queries: client.videos_by(:query => \"penguin\") client.videos_by(:tags => ['tiger', 'leopard']) client.videos_by(:categories => [:news, :sports]) client.videos_by(:categories => [:news, :sports], :tags => ['soccer', 'football']) client.videos_by(:user => 'liz') Standard feeds: client.videos_by(:most_viewed) client.videos_by(:top_rated, :time => :today) Advanced queries (with boolean operators OR (either), AND (include), NOT (exclude)): client.videos_by(:categories => { :either => [:news, :sports], :exclude => [:comedy] }, :tags => { :include => ['football'], :exclude => ['soccer'] })"
15
15
  autorequire:
16
16
  default_executable:
17
17
  bindir: bin
@@ -80,5 +80,5 @@ dependencies:
80
80
  requirements:
81
81
  - - ">="
82
82
  - !ruby/object:Gem::Version
83
- version: 1.3.0
83
+ version: 1.5.0
84
84
  version: