douban_api 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -318,7 +318,7 @@ module Douban
318
318
  # client.books()
319
319
  # TODO 可以允许options[:from]和options[:to]传入ruby日期对象
320
320
  def books(name=nil, options={})
321
- if user_id.nil?
321
+ if name.nil?
322
322
  response = get("v2/book/user/#{get_user_id}/collections", options)
323
323
  else
324
324
  response = get("v2/book/user/#{name}/collections", options)
@@ -10,12 +10,39 @@ module Douban
10
10
  # @authenticated false
11
11
  # @param id [String] 电影的id
12
12
  # @return [Hashie::Mash] 电影信息
13
- # @example 获取 id为1296987 的电影信息
14
- # Douban.movie('1296987')
13
+ # @example 获取 id为1054432 的电影信息
14
+ # Douban.movie('1054432')
15
15
  def movie(id)
16
16
  response = get "v2/movie/#{id}"
17
17
  end
18
18
 
19
+ # 获取影人信息
20
+ #
21
+ # @see http://developers.douban.com/wiki/64/#get-celebrity
22
+ # @scope movie_basic_r
23
+ # @authenticated false
24
+ # @param id [String] 影人的id
25
+ # @return [Hashie::Mash] 影人信息
26
+ # @example 获取 id为1054432 的影人信息
27
+ # Douban.celebrity('1054432')
28
+ def celebrity(id)
29
+ response = get "v2/movie/celebrity/#{id}"
30
+ end
31
+
32
+ # 获取影人作品
33
+ #
34
+ # @see http://developers.douban.com/wiki/64/#get-celebrity
35
+ # @scope movie_basic_r
36
+ # @authenticated false
37
+ # @param id [String] 影人的id
38
+ # @return [Array<Hashie::Mash>] 影人作品列表
39
+ # @example 获取 id为1296987 的影人的作品列表
40
+ # Douban.celebrity_works('1054432')
41
+ def celebrity_works(id)
42
+ response = get "v2/movie/celebrity/#{id}/works"
43
+ response["works"]
44
+ end
45
+
19
46
  # 根据imdb号获取电影信息
20
47
  #
21
48
  # @scope movie_basic_r
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Douban
3
- VERSION = '0.1.4'.freeze unless defined?(::Douban::VERSION)
3
+ VERSION = '0.1.5'.freeze unless defined?(::Douban::VERSION)
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: douban_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
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: 2013-01-06 00:00:00.000000000 Z
12
+ date: 2013-03-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -253,7 +253,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
253
253
  version: '0'
254
254
  segments:
255
255
  - 0
256
- hash: 410308200798971739
256
+ hash: 2295320559761503597
257
257
  required_rubygems_version: !ruby/object:Gem::Requirement
258
258
  none: false
259
259
  requirements:
@@ -262,7 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
262
262
  version: 1.3.6
263
263
  requirements: []
264
264
  rubyforge_project:
265
- rubygems_version: 1.8.24
265
+ rubygems_version: 1.8.25
266
266
  signing_key:
267
267
  specification_version: 3
268
268
  summary: Ruby wrapper for the Douban API v2