nicovideo 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ 2008-02-25 version 0.1.1
2
+
3
+ * fixed typo in Nicovideo::Ranking#url
4
+ * added sample using Nicovideo#ranking method
5
+ (ref: http://d.hatena.ne.jp/hayori/20080225/1203911215)
6
+
1
7
  2008-02-24 version 0.1.0
2
8
 
3
9
  * added functions to search, tagsearch, ranking
@@ -9,11 +9,10 @@ module Nicovideo
9
9
  self.register_getter ["videos"]
10
10
  end
11
11
 
12
- # call whenever pagenum changed
13
12
  def url
14
13
  url = "#{BASE_URL}/ranking/#{@type}/#{@span}/#{@category}"
15
14
  if @pagenum
16
- url += '?page=' + pagenum.to_s
15
+ url += '?page=' + @pagenum.to_s
17
16
  end
18
17
  url
19
18
  end
@@ -2,7 +2,7 @@ module Nicovideo #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/ruby -Ku
2
+
3
+ require 'rubygems'
4
+ require 'nicovideo'
5
+
6
+ conf = YAML.load_file(ENV['HOME'] + '/.nicovideo/account.yml')
7
+ nv = Nicovideo.new(conf['mail'], conf['password'])
8
+
9
+ cnt = 0
10
+ nv.ranking.each do |vp|
11
+ cnt += 1
12
+ printf "%3d位 %-12s %s \n", cnt, vp.video_id, vp.title
13
+ end
14
+
15
+ =begin
16
+ # when using more options
17
+ nv.ranking(type='mylist', span='daily', category='all', pagenum='1').each do |vp|
18
+ cnt += 1
19
+ printf "%3d位 %-12s %s \n", cnt, vp.video_id, vp.title
20
+ end
21
+ =end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: nicovideo
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.0
7
- date: 2008-02-24 00:00:00 +09:00
6
+ version: 0.1.1
7
+ date: 2008-02-25 00:00:00 +09:00
8
8
  summary: utils for nicovideo
9
9
  require_paths:
10
10
  - lib
@@ -60,6 +60,7 @@ files:
60
60
  - sample/nv_download2.rb
61
61
  - sample/nv_mylist.rb
62
62
  - sample/nv_openlist.rb
63
+ - sample/nv_ranking.rb
63
64
  test_files:
64
65
  - test/test_openlist.rb
65
66
  - test/test_nicovideo.rb