traktr 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +36 -2
- data/lib/traktr.rb +2 -11
- data/lib/traktr/account.rb +11 -8
- data/lib/traktr/client.rb +57 -0
- data/lib/traktr/movie.rb +33 -29
- data/lib/traktr/movies.rb +9 -5
- data/lib/traktr/search.rb +15 -11
- data/lib/traktr/show.rb +53 -37
- data/lib/traktr/show/episode.rb +30 -26
- data/lib/traktr/show/season.rb +12 -8
- data/lib/traktr/shows.rb +9 -5
- data/lib/traktr/user.rb +20 -16
- data/lib/traktr/user/calendar.rb +2 -2
- data/lib/traktr/user/library/movies.rb +6 -6
- data/lib/traktr/user/library/shows.rb +6 -6
- data/lib/traktr/user/network.rb +6 -6
- data/lib/traktr/user/progress.rb +4 -4
- data/lib/traktr/user/ratings.rb +6 -6
- data/lib/traktr/user/watchlist.rb +6 -6
- data/lib/traktr/version.rb +1 -1
- data/spec/account_spec.rb +9 -27
- data/spec/movie_spec.rb +38 -66
- data/spec/movies_spec.rb +9 -11
- data/spec/search_spec.rb +15 -20
- data/spec/show_episode_spec.rb +35 -63
- data/spec/show_season_spec.rb +11 -35
- data/spec/show_spec.rb +47 -76
- data/spec/shows_spec.rb +9 -11
- data/traktr.gemspec +2 -2
- metadata +6 -5
- data/lib/traktr/authentication.rb +0 -29
data/lib/traktr/show/episode.rb
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
module Traktr
|
2
|
-
|
3
|
-
|
2
|
+
class Show
|
3
|
+
class Episode
|
4
4
|
include HTTParty
|
5
5
|
base_uri File.join(Traktr::Show.base_uri, "episode")
|
6
|
+
|
7
|
+
def initialize(client)
|
8
|
+
@client = client
|
9
|
+
end
|
6
10
|
|
7
11
|
##
|
8
12
|
## show-episode GET methods
|
9
13
|
##
|
10
|
-
def
|
11
|
-
response = self.get("/" + File.join("comments.json",
|
14
|
+
def comments(title, season, episode)
|
15
|
+
response = self.class.get("/" + File.join("comments.json", @client.api_key, title, season.to_s, episode.to_s))
|
12
16
|
raise ResponseError.new(response) if response.code != 200
|
13
17
|
|
14
18
|
response.parsed_response.collect do |comment|
|
@@ -16,15 +20,15 @@ module Traktr
|
|
16
20
|
end
|
17
21
|
end
|
18
22
|
|
19
|
-
def
|
20
|
-
response = self.get("/" + File.join("summary.json",
|
23
|
+
def summary(title, season, episode)
|
24
|
+
response = self.class.get("/" + File.join("summary.json", @client.api_key, title, season.to_s, episode.to_s))
|
21
25
|
raise ResponseError.new(response) if response.code != 200
|
22
26
|
|
23
27
|
Mash.new(response.parsed_response)
|
24
28
|
end
|
25
29
|
|
26
|
-
def
|
27
|
-
response = self.get("/" + File.join("watchingnow.json",
|
30
|
+
def watchingnow(title, season, episode)
|
31
|
+
response = self.class.get("/" + File.join("watchingnow.json", @client.api_key, title, season.to_s, episode.to_s))
|
28
32
|
raise ResponseError.new(response) if response.code != 200
|
29
33
|
|
30
34
|
response.parsed_response.collect do |user|
|
@@ -36,73 +40,73 @@ module Traktr
|
|
36
40
|
##
|
37
41
|
## show-episode POST methods
|
38
42
|
##
|
39
|
-
def
|
43
|
+
def library(show, episodes)
|
40
44
|
data = {
|
41
|
-
username:
|
45
|
+
username: @client.username, password: @client.password,
|
42
46
|
title: show.title, year: show.year, imdb_id: show.imdb_id, tvdb_id: show.tvdb_id,
|
43
47
|
episodes: episodes.collect{ |e| { season: e.season, episode: e.episode } }
|
44
48
|
}
|
45
|
-
response = self.post("/" + File.join("library",
|
49
|
+
response = self.class.post("/" + File.join("library", @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
|
46
50
|
raise ResponseError.new(response) if response.code != 200
|
47
51
|
|
48
52
|
Mash.new(response.parsed_response)
|
49
53
|
end
|
50
54
|
|
51
|
-
def
|
55
|
+
def unlibrary(show, episodes)
|
52
56
|
data = {
|
53
|
-
username:
|
57
|
+
username: @client.username, password: @client.password,
|
54
58
|
title: show.title, year: show.year, imdb_id: show.imdb_id, tvdb_id: show.tvdb_id,
|
55
59
|
episodes: episodes.collect{ |e| { season: e.season, episode: e.episode } }
|
56
60
|
}
|
57
|
-
response = self.post("/" + File.join("unlibrary",
|
61
|
+
response = self.class.post("/" + File.join("unlibrary", @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
|
58
62
|
raise ResponseError.new(response) if response.code != 200
|
59
63
|
|
60
64
|
Mash.new(response.parsed_response)
|
61
65
|
end
|
62
66
|
|
63
|
-
def
|
67
|
+
def seen(show, episodes)
|
64
68
|
data = {
|
65
|
-
username:
|
69
|
+
username: @client.username, password: @client.password,
|
66
70
|
title: show.title, year: show.year, imdb_id: show.imdb_id, tvdb_id: show.tvdb_id,
|
67
71
|
episodes: episodes.collect{ |e| { season: e.season, episode: e.episode } }
|
68
72
|
}
|
69
|
-
response = self.post("/" + File.join("seen",
|
73
|
+
response = self.class.post("/" + File.join("seen", @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
|
70
74
|
raise ResponseError.new(response) if response.code != 200
|
71
75
|
|
72
76
|
Mash.new(response.parsed_response)
|
73
77
|
end
|
74
78
|
|
75
|
-
def
|
79
|
+
def unseen(show, episodes)
|
76
80
|
data = {
|
77
|
-
username:
|
81
|
+
username: @client.username, password: @client.password,
|
78
82
|
title: show.title, year: show.year, imdb_id: show.imdb_id, tvdb_id: show.tvdb_id,
|
79
83
|
episodes: episodes.collect{ |e| { season: e.season, episode: e.episode } }
|
80
84
|
}
|
81
|
-
response = self.post("/" + File.join("unseen",
|
85
|
+
response = self.class.post("/" + File.join("unseen", @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
|
82
86
|
raise ResponseError.new(response) if response.code != 200
|
83
87
|
|
84
88
|
Mash.new(response.parsed_response)
|
85
89
|
end
|
86
90
|
|
87
|
-
def
|
91
|
+
def watchlist(show, episodes)
|
88
92
|
data = {
|
89
|
-
username:
|
93
|
+
username: @client.username, password: @client.password,
|
90
94
|
title: show.title, year: show.year, imdb_id: show.imdb_id, tvdb_id: show.tvdb_id,
|
91
95
|
episodes: episodes.collect{ |e| { season: e.season, episode: e.episode } }
|
92
96
|
}
|
93
|
-
response = self.post("/" + File.join("watchlist",
|
97
|
+
response = self.class.post("/" + File.join("watchlist", @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
|
94
98
|
raise ResponseError.new(response) if response.code != 200
|
95
99
|
|
96
100
|
Mash.new(response.parsed_response)
|
97
101
|
end
|
98
102
|
|
99
|
-
def
|
103
|
+
def unwatchlist(show, episodes)
|
100
104
|
data = {
|
101
|
-
username:
|
105
|
+
username: @client.username, password: @client.password,
|
102
106
|
title: show.title, year: show.year, imdb_id: show.imdb_id, tvdb_id: show.tvdb_id,
|
103
107
|
episodes: episodes.collect{ |e| { season: e.season, episode: e.episode } }
|
104
108
|
}
|
105
|
-
response = self.post("/" + File.join("unwatchlist",
|
109
|
+
response = self.class.post("/" + File.join("unwatchlist", @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
|
106
110
|
raise ResponseError.new(response) if response.code != 200
|
107
111
|
|
108
112
|
Mash.new(response.parsed_response)
|
data/lib/traktr/show/season.rb
CHANGED
@@ -1,31 +1,35 @@
|
|
1
1
|
module Traktr
|
2
|
-
|
3
|
-
|
2
|
+
class Show
|
3
|
+
class Season
|
4
4
|
include HTTParty
|
5
5
|
base_uri File.join(Traktr::Show.base_uri, "season")
|
6
6
|
|
7
|
+
def initialize(client)
|
8
|
+
@client = client
|
9
|
+
end
|
10
|
+
|
7
11
|
##
|
8
12
|
## show-season POST methods
|
9
13
|
##
|
10
|
-
def
|
14
|
+
def library(show, season)
|
11
15
|
data = {
|
12
|
-
username:
|
16
|
+
username: @client.username, password: @client.password,
|
13
17
|
title: show.title, year: show.year, imdb_id: show.imdb_id, tvdb_id: show.tvdb_id,
|
14
18
|
season: season
|
15
19
|
}
|
16
|
-
response = self.post("/" + File.join("library",
|
20
|
+
response = self.class.post("/" + File.join("library", @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
|
17
21
|
raise ResponseError.new(response) if response.code != 200
|
18
22
|
|
19
23
|
Mash.new(response.parsed_response)
|
20
24
|
end
|
21
25
|
|
22
|
-
def
|
26
|
+
def seen(show, season)
|
23
27
|
data = {
|
24
|
-
username:
|
28
|
+
username: @client.username, password: @client.password,
|
25
29
|
title: show.title, year: show.year, imdb_id: show.imdb_id, tvdb_id: show.tvdb_id,
|
26
30
|
season: season
|
27
31
|
}
|
28
|
-
response = self.post("/" + File.join("seen",
|
32
|
+
response = self.class.post("/" + File.join("seen", @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
|
29
33
|
raise ResponseError.new(response) if response.code != 200
|
30
34
|
|
31
35
|
Mash.new(response.parsed_response)
|
data/lib/traktr/shows.rb
CHANGED
@@ -1,13 +1,17 @@
|
|
1
1
|
module Traktr
|
2
|
-
|
2
|
+
class Shows
|
3
3
|
include HTTParty
|
4
4
|
base_uri File.join(Traktr.base_uri, 'shows')
|
5
5
|
|
6
|
+
def initialize(client)
|
7
|
+
@client = client
|
8
|
+
end
|
9
|
+
|
6
10
|
##
|
7
11
|
## movies GET methods
|
8
12
|
##
|
9
|
-
def
|
10
|
-
response = self.get('/' + File.join('trending.json',
|
13
|
+
def trending
|
14
|
+
response = self.class.get('/' + File.join('trending.json', @client.api_key))
|
11
15
|
raise ResponseError.new(response) if response.code != 200
|
12
16
|
|
13
17
|
response.parsed_response.collect do |show|
|
@@ -15,8 +19,8 @@ module Traktr
|
|
15
19
|
end
|
16
20
|
end
|
17
21
|
|
18
|
-
def
|
19
|
-
response = self.get('/' + File.join('updated.json',
|
22
|
+
def updated(timestamp)
|
23
|
+
response = self.class.get('/' + File.join('updated.json', @client.api_key, timestamp.to_i.to_s))
|
20
24
|
raise ResponseError.new(response) if response.code != 200
|
21
25
|
|
22
26
|
Mash.new(response.parsed_response)
|
data/lib/traktr/user.rb
CHANGED
@@ -1,24 +1,28 @@
|
|
1
1
|
module Traktr
|
2
|
-
|
2
|
+
class User
|
3
3
|
include HTTParty
|
4
4
|
base_uri File.join(Traktr.base_uri, "user")
|
5
5
|
|
6
|
-
def
|
7
|
-
|
6
|
+
def initialize(client)
|
7
|
+
@client = client
|
8
|
+
end
|
9
|
+
|
10
|
+
def lastactivity(user = @client.username)
|
11
|
+
response = self.class.get("/" + File.join("lastactivity.json", @client.api_key, user))
|
8
12
|
raise ResponseError.new(response) if response.code != 200
|
9
13
|
|
10
14
|
Mash.new(response.parsed_response)
|
11
15
|
end
|
12
16
|
|
13
|
-
def
|
14
|
-
response = self.get("/" + File.join("list.json",
|
17
|
+
def list(slug, user = @client.username)
|
18
|
+
response = self.class.get("/" + File.join("list.json", @client.api_key, user, slug))
|
15
19
|
raise ResponseError.new(response) if response.code != 200
|
16
20
|
|
17
21
|
Mash.new(response.parsed_response)
|
18
22
|
end
|
19
23
|
|
20
|
-
def
|
21
|
-
response = self.get("/" + File.join("lists.json",
|
24
|
+
def lists(user = @client.username)
|
25
|
+
response = self.class.get("/" + File.join("lists.json", @client.api_key, user))
|
22
26
|
raise ResponseError.new(response) if response.code != 200
|
23
27
|
|
24
28
|
response.parsed_response.collect do |item|
|
@@ -26,15 +30,15 @@ module Traktr
|
|
26
30
|
end
|
27
31
|
end
|
28
32
|
|
29
|
-
def
|
30
|
-
response = self.get("/" + File.join("profile.json",
|
33
|
+
def profile(user = @client.username)
|
34
|
+
response = self.class.get("/" + File.join("profile.json", @client.api_key, user))
|
31
35
|
raise ResponseError.new(response) if response.code != 200
|
32
36
|
|
33
37
|
Mash.new(response.parsed_response)
|
34
38
|
end
|
35
39
|
|
36
|
-
def
|
37
|
-
response = self.get("/" + File.join("watching.json",
|
40
|
+
def watching(user = @client.username)
|
41
|
+
response = self.class.get("/" + File.join("watching.json", @client.api_key, user))
|
38
42
|
raise ResponseError.new(response) if response.code != 200
|
39
43
|
|
40
44
|
response.parsed_response.collect do |item|
|
@@ -44,8 +48,8 @@ module Traktr
|
|
44
48
|
end
|
45
49
|
end
|
46
50
|
|
47
|
-
require 'traktr/user/library'
|
48
|
-
require 'traktr/user/network'
|
49
|
-
require 'traktr/user/progress'
|
50
|
-
require 'traktr/user/ratings'
|
51
|
-
require 'traktr/user/watchlist'
|
51
|
+
#require 'traktr/user/library'
|
52
|
+
#require 'traktr/user/network'
|
53
|
+
#require 'traktr/user/progress'
|
54
|
+
#require 'traktr/user/ratings'
|
55
|
+
#require 'traktr/user/watchlist'
|
data/lib/traktr/user/calendar.rb
CHANGED
@@ -4,9 +4,9 @@ module Traktr
|
|
4
4
|
include HTTParty
|
5
5
|
base_uri File.join(Traktr::User.base_uri, 'calendar')
|
6
6
|
|
7
|
-
def
|
7
|
+
def shows(username = @client.username, date = Date.today, days = 7)
|
8
8
|
date = date.strftime('%Y%m%d') if date.class == Date
|
9
|
-
response = self.get('/' + File.join('shows.json',
|
9
|
+
response = self.class.get('/' + File.join('shows.json', @client.api_key, username, date, days.to_s))
|
10
10
|
raise ResponseError.new(response) if response.code != 200
|
11
11
|
|
12
12
|
response.parsed_response.collect do |item|
|
@@ -5,8 +5,8 @@ module Traktr
|
|
5
5
|
include HTTParty
|
6
6
|
base_uri File.join(Traktr::User::Library.base_uri, 'movies')
|
7
7
|
|
8
|
-
def
|
9
|
-
response = self.get('/' + File.join('all.json',
|
8
|
+
def all(username = @client.username, extended = :min)
|
9
|
+
response = self.class.get('/' + File.join('all.json', @client.api_key, username, extended.to_s))
|
10
10
|
raise ResponseError.new(response) if response.code != 200
|
11
11
|
|
12
12
|
response.parsed_response.collect do |item|
|
@@ -14,8 +14,8 @@ module Traktr
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
18
|
-
response = self.get('/' + File.join('collection.json',
|
17
|
+
def collection(username = @client.username, extended = :min)
|
18
|
+
response = self.class.get('/' + File.join('collection.json', @client.api_key, username, extended.to_s))
|
19
19
|
raise ResponseError.new(response) if response.code != 200
|
20
20
|
|
21
21
|
response.parsed_response.collect do |item|
|
@@ -23,8 +23,8 @@ module Traktr
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
def
|
27
|
-
response = self.get('/' + File.join('watched.json',
|
26
|
+
def watched(username = @client.username, extended = :min)
|
27
|
+
response = self.class.get('/' + File.join('watched.json', @client.api_key, username, extended.to_s))
|
28
28
|
raise ResponseError.new(response) if response.code != 200
|
29
29
|
|
30
30
|
response.parsed_response.collect do |item|
|
@@ -5,8 +5,8 @@ module Traktr
|
|
5
5
|
include HTTParty
|
6
6
|
base_uri File.join(Traktr::User::Library.base_uri, 'shows')
|
7
7
|
|
8
|
-
def
|
9
|
-
response = self.get('/' + File.join('all.json',
|
8
|
+
def all(username = @client.username, extended = :min)
|
9
|
+
response = self.class.get('/' + File.join('all.json', @client.api_key, username, extended.to_s))
|
10
10
|
raise ResponseError.new(response) if response.code != 200
|
11
11
|
|
12
12
|
response.parsed_response.collect do |item|
|
@@ -14,8 +14,8 @@ module Traktr
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
18
|
-
response = self.get('/' + File.join('collection.json',
|
17
|
+
def collection(username = @client.username, extended = :min)
|
18
|
+
response = self.class.get('/' + File.join('collection.json', @client.api_key, username, extended.to_s))
|
19
19
|
raise ResponseError.new(response) if response.code != 200
|
20
20
|
|
21
21
|
response.parsed_response.collect do |item|
|
@@ -23,8 +23,8 @@ module Traktr
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
def
|
27
|
-
response = self.get('/' + File.join('watched.json',
|
26
|
+
def watched(username = @client.username, extended = :min)
|
27
|
+
response = self.class.get('/' + File.join('watched.json', @client.api_key, username, extended.to_s))
|
28
28
|
raise ResponseError.new(response) if response.code != 200
|
29
29
|
|
30
30
|
response.parsed_response.collect do |item|
|
data/lib/traktr/user/network.rb
CHANGED
@@ -4,8 +4,8 @@ module Traktr
|
|
4
4
|
include HTTParty
|
5
5
|
base_uri File.join(Traktr::User.base_uri, 'network')
|
6
6
|
|
7
|
-
def
|
8
|
-
response = self.get('/' + File.join('followers.json',
|
7
|
+
def followers(username = @client.username)
|
8
|
+
response = self.class.get('/' + File.join('followers.json', @client.api_key, username))
|
9
9
|
raise ResponseError.new(response) if response.code != 200
|
10
10
|
|
11
11
|
response.parsed_response.collect do |item|
|
@@ -13,8 +13,8 @@ module Traktr
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
17
|
-
response = self.get('/' + File.join('following.json',
|
16
|
+
def following(username = @client.username)
|
17
|
+
response = self.class.get('/' + File.join('following.json', @client.api_key, username))
|
18
18
|
raise ResponseError.new(response) if response.code != 200
|
19
19
|
|
20
20
|
response.parsed_response.collect do |item|
|
@@ -22,8 +22,8 @@ module Traktr
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
def
|
26
|
-
response = self.get('/' + File.join('friends.json',
|
25
|
+
def friends(username = @client.username)
|
26
|
+
response = self.class.get('/' + File.join('friends.json', @client.api_key, username))
|
27
27
|
raise ResponseError.new(response) if response.code != 200
|
28
28
|
|
29
29
|
response.parsed_response.collect do |item|
|
data/lib/traktr/user/progress.rb
CHANGED
@@ -4,8 +4,8 @@ module Traktr
|
|
4
4
|
include HTTParty
|
5
5
|
base_uri File.join(Traktr::User.base_uri, 'progress')
|
6
6
|
|
7
|
-
def
|
8
|
-
response = self.get('/' + File.join('collected.json',
|
7
|
+
def collected(username = @client.username, title = :all, sort = :title, extended = :min)
|
8
|
+
response = self.class.get('/' + File.join('collected.json', @client.api_key, username, title.to_s, sort.to_s, extended.to_s))
|
9
9
|
raise ResponseError.new(response) if response.code != 200
|
10
10
|
|
11
11
|
response.parsed_response.collect do |item|
|
@@ -13,8 +13,8 @@ module Traktr
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
17
|
-
response = self.get('/' + File.join('watched.json',
|
16
|
+
def watched(username = @client.username, title = :all, sort = :title, extended = :min)
|
17
|
+
response = self.class.get('/' + File.join('watched.json', @client.api_key, username, title.to_s, sort.to_s, extended.to_s))
|
18
18
|
raise ResponseError.new(response) if response.code != 200
|
19
19
|
|
20
20
|
response.parsed_response.collect do |item|
|
data/lib/traktr/user/ratings.rb
CHANGED
@@ -4,8 +4,8 @@ module Traktr
|
|
4
4
|
include HTTParty
|
5
5
|
base_uri File.join(Traktr::User.base_uri, 'ratings')
|
6
6
|
|
7
|
-
def
|
8
|
-
response = self.get('/' + File.join('episodes.json',
|
7
|
+
def episodes(username = @client.username, rating = :all, extended = :min)
|
8
|
+
response = self.class.get('/' + File.join('episodes.json', @client.api_key, username, rating.to_s, extended.to_s))
|
9
9
|
raise ResponseError.new(response) if response.code != 200
|
10
10
|
|
11
11
|
response.parsed_response.collect do |item|
|
@@ -13,8 +13,8 @@ module Traktr
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
17
|
-
response = self.get('/' + File.join('movies.json',
|
16
|
+
def movies(username = @client.username, rating = :all, extended = :min)
|
17
|
+
response = self.class.get('/' + File.join('movies.json', @client.api_key, username, rating.to_s, extended.to_s))
|
18
18
|
raise ResponseError.new(response) if response.code != 200
|
19
19
|
|
20
20
|
response.parsed_response.collect do |item|
|
@@ -22,8 +22,8 @@ module Traktr
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
def
|
26
|
-
response = self.get('/' + File.join('shows.json',
|
25
|
+
def shows(username = @client.username, rating = :all, extended = :min)
|
26
|
+
response = self.class.get('/' + File.join('shows.json', @client.api_key, username, rating.to_s, extended.to_s))
|
27
27
|
raise ResponseError.new(response) if response.code != 200
|
28
28
|
|
29
29
|
response.parsed_response.collect do |item|
|
@@ -4,8 +4,8 @@ module Traktr
|
|
4
4
|
include HTTParty
|
5
5
|
base_uri File.join(Traktr::User.base_uri, 'watchlist')
|
6
6
|
|
7
|
-
def
|
8
|
-
response = self.get('/' + File.join('episodes.json',
|
7
|
+
def episodes(username = @client.username)
|
8
|
+
response = self.class.get('/' + File.join('episodes.json', @client.api_key, username))
|
9
9
|
raise ResponseError.new(response) if response.code != 200
|
10
10
|
|
11
11
|
response.parsed_response.collect do |item|
|
@@ -13,8 +13,8 @@ module Traktr
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
17
|
-
response = self.get('/' + File.join('movies.json',
|
16
|
+
def movies(username = @client.username)
|
17
|
+
response = self.class.get('/' + File.join('movies.json', @client.api_key, username))
|
18
18
|
raise ResponseError.new(response) if response.code != 200
|
19
19
|
|
20
20
|
response.parsed_response.collect do |item|
|
@@ -22,8 +22,8 @@ module Traktr
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
def
|
26
|
-
response = self.get('/' + File.join('shows.json',
|
25
|
+
def shows(username = @client.username)
|
26
|
+
response = self.class.get('/' + File.join('shows.json', @client.api_key, username))
|
27
27
|
raise ResponseError.new(response) if response.code != 200
|
28
28
|
|
29
29
|
response.parsed_response.collect do |item|
|