trakt_api 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.travis.yml +3 -1
- data/README.md +21 -209
- data/lib/trakt_api.rb +3 -17
- data/lib/trakt_api/base.rb +35 -68
- data/lib/trakt_api/client.rb +6 -67
- data/lib/trakt_api/search.rb +7 -18
- data/lib/trakt_api/version.rb +1 -1
- data/spec/fixtures/search.json +125 -0
- data/spec/functionals/search_spec.rb +23 -0
- data/spec/integrations/search_spec.rb +9 -30
- data/spec/spec_helper.rb +2 -38
- data/spec/support/.keep +0 -0
- data/spec/support/trakt_api.rb.example +1 -0
- data/trakt_api.gemspec +4 -3
- metadata +42 -94
- data/lib/generators/templates/trakt_api.rb +0 -5
- data/lib/generators/trakt_api/install_generator.rb +0 -12
- data/lib/trakt_api/account.rb +0 -16
- data/lib/trakt_api/activity.rb +0 -94
- data/lib/trakt_api/calendar.rb +0 -17
- data/lib/trakt_api/comment.rb +0 -16
- data/lib/trakt_api/configuration.rb +0 -7
- data/lib/trakt_api/genres.rb +0 -11
- data/lib/trakt_api/lists.rb +0 -26
- data/lib/trakt_api/movie.rb +0 -86
- data/lib/trakt_api/movies.rb +0 -11
- data/lib/trakt_api/network.rb +0 -26
- data/lib/trakt_api/rate.rb +0 -31
- data/lib/trakt_api/recommendations.rb +0 -21
- data/lib/trakt_api/server.rb +0 -6
- data/lib/trakt_api/show.rb +0 -151
- data/lib/trakt_api/shows.rb +0 -11
- data/lib/trakt_api/user.rb +0 -116
- data/spec/integration_spec_helper.rb +0 -3
- data/spec/integrations/account_spec.rb +0 -19
- data/spec/integrations/calendar_spec.rb +0 -31
- data/spec/integrations/client_spec.rb +0 -173
- data/spec/integrations/genres_spec.rb +0 -19
- data/spec/integrations/movies_spec.rb +0 -25
- data/spec/integrations/network_spec.rb +0 -37
- data/spec/integrations/server_spec.rb +0 -13
- data/spec/integrations/shows_spec.rb +0 -25
- data/spec/integrations/support/trakt_api.rb.example +0 -5
- data/spec/trakt_api/account_spec.rb +0 -56
- data/spec/trakt_api/activity_spec.rb +0 -243
- data/spec/trakt_api/base_spec.rb +0 -140
- data/spec/trakt_api/calendar_spec.rb +0 -48
- data/spec/trakt_api/client_spec.rb +0 -101
- data/spec/trakt_api/comment_spec.rb +0 -69
- data/spec/trakt_api/genres_spec.rb +0 -24
- data/spec/trakt_api/lists_spec.rb +0 -111
- data/spec/trakt_api/movie_spec.rb +0 -345
- data/spec/trakt_api/movies_spec.rb +0 -44
- data/spec/trakt_api/network_spec.rb +0 -105
- data/spec/trakt_api/rate_spec.rb +0 -132
- data/spec/trakt_api/recommendations_spec.rb +0 -90
- data/spec/trakt_api/search_spec.rb +0 -81
- data/spec/trakt_api/server_spec.rb +0 -15
- data/spec/trakt_api/show_spec.rb +0 -618
- data/spec/trakt_api/shows_spec.rb +0 -44
- data/spec/trakt_api/user_spec.rb +0 -489
data/lib/trakt_api/shows.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
class TraktApi::Shows < TraktApi::Base
|
2
|
-
# documentation: http://trakt.tv/api-docs/shows-trending
|
3
|
-
def trending(options = {})
|
4
|
-
get('shows/trending').params(options).response
|
5
|
-
end
|
6
|
-
|
7
|
-
# documentation: http://trakt.tv/api-docs/shows-updated
|
8
|
-
def updated(options = {})
|
9
|
-
get('shows/updated').params(options).restful_params([:time]).response
|
10
|
-
end
|
11
|
-
end
|
data/lib/trakt_api/user.rb
DELETED
@@ -1,116 +0,0 @@
|
|
1
|
-
class TraktApi::User < TraktApi::Base
|
2
|
-
# documentation: http://trakt.tv/api-docs/user-calendar-shows
|
3
|
-
def calendar_shows(options = {})
|
4
|
-
get('user/calendar/shows').params(options).restful_params([:username, :date, :days]).response
|
5
|
-
end
|
6
|
-
|
7
|
-
# documentation: http://trakt.tv/api-docs/user-lastactivity
|
8
|
-
def last_activity(options = {})
|
9
|
-
get('user/lastactivity').params(options).restful_params([:username]).response
|
10
|
-
end
|
11
|
-
|
12
|
-
# documentation: http://trakt.tv/api-docs/user-library-movies-all
|
13
|
-
def library_movies_all(options = {})
|
14
|
-
get('user/library/movies/all').params(options).restful_params([:username]).response
|
15
|
-
end
|
16
|
-
|
17
|
-
# documentation: http://trakt.tv/api-docs/user-library-movies-collection
|
18
|
-
def library_movies_collection(options = {})
|
19
|
-
get('user/library/movies/collection').params(options).restful_params([:username]).response
|
20
|
-
end
|
21
|
-
|
22
|
-
# documentation: http://trakt.tv/api-docs/user-library-movies-watched
|
23
|
-
def library_movies_watched(options = {})
|
24
|
-
get('user/library/movies/watched').params(options).restful_params([:username]).response
|
25
|
-
end
|
26
|
-
|
27
|
-
# documentation: http://trakt.tv/api-docs/user-library-shows-all
|
28
|
-
def library_shows_all(options = {})
|
29
|
-
get('user/library/shows/all').params(options).restful_params([:username]).response
|
30
|
-
end
|
31
|
-
|
32
|
-
# documentation: http://trakt.tv/api-docs/user-library-shows-collection
|
33
|
-
def library_shows_collection(options = {})
|
34
|
-
get('user/library/shows/collection').params(options).restful_params([:username]).response
|
35
|
-
end
|
36
|
-
|
37
|
-
# documentation: http://trakt.tv/api-docs/user-library-shows-watched
|
38
|
-
def library_shows_watched(options = {})
|
39
|
-
get('user/library/shows/watched').params(options).restful_params([:username]).response
|
40
|
-
end
|
41
|
-
|
42
|
-
# documentation: http://trakt.tv/api-docs/user-list
|
43
|
-
def list(options = {})
|
44
|
-
get('user/list').params(options).restful_params([:username, :slug]).response
|
45
|
-
end
|
46
|
-
|
47
|
-
# documentation: http://trakt.tv/api-docs/user-lists
|
48
|
-
def lists(options = {})
|
49
|
-
get('user/lists').params(options).restful_params([:username]).response
|
50
|
-
end
|
51
|
-
|
52
|
-
# documentation: http://trakt.tv/api-docs/user-network-followers
|
53
|
-
def network_followers(options = {})
|
54
|
-
get('user/network/followers').params(options).restful_params([:username]).response
|
55
|
-
end
|
56
|
-
|
57
|
-
# documentation: http://trakt.tv/api-docs/user-network-following
|
58
|
-
def network_following(options = {})
|
59
|
-
get('user/network/following').params(options).restful_params([:username]).response
|
60
|
-
end
|
61
|
-
|
62
|
-
# documentation: http://trakt.tv/api-docs/user-network-friends
|
63
|
-
def network_friends(options = {})
|
64
|
-
get('user/network/friends').params(options).restful_params([:username]).response
|
65
|
-
end
|
66
|
-
|
67
|
-
# documentation: http://trakt.tv/api-docs/user-profile
|
68
|
-
def profile(options = {})
|
69
|
-
get('user/profile').params(options).restful_params([:username]).response
|
70
|
-
end
|
71
|
-
|
72
|
-
# documentation: http://trakt.tv/api-docs/user-progress-collected
|
73
|
-
def progress_collected(options = {})
|
74
|
-
get('user/progress/collected').params(options).restful_params([:username, :title, :sort, :extended]).response
|
75
|
-
end
|
76
|
-
|
77
|
-
# documentation: http://trakt.tv/api-docs/user-progress-watched
|
78
|
-
def progress_watched(options = {})
|
79
|
-
get('user/progress/watched').params(options).restful_params([:username, :title, :sort, :extended]).response
|
80
|
-
end
|
81
|
-
|
82
|
-
# documentation: http://trakt.tv/api-docs/user-ratings-episodes
|
83
|
-
def ratings_episodes(options = {})
|
84
|
-
get('user/ratings/episodes').params(options).restful_params([:username, :rating, :extended]).response
|
85
|
-
end
|
86
|
-
|
87
|
-
# documentation: http://trakt.tv/api-docs/user-ratings-movies
|
88
|
-
def ratings_movies(options = {})
|
89
|
-
get('user/ratings/movies').params(options).restful_params([:username, :rating, :extended]).response
|
90
|
-
end
|
91
|
-
|
92
|
-
# documentation: http://trakt.tv/api-docs/user-ratings-shows
|
93
|
-
def ratings_shows(options = {})
|
94
|
-
get('user/ratings/shows').params(options).restful_params([:username, :rating, :extended]).response
|
95
|
-
end
|
96
|
-
|
97
|
-
# documentation: http://trakt.tv/api-docs/user-watching
|
98
|
-
def watching(options = {})
|
99
|
-
get('user/watching').params(options).restful_params([:username]).response
|
100
|
-
end
|
101
|
-
|
102
|
-
# documentation: http://trakt.tv/api-docs/user-watchlist-episodes
|
103
|
-
def watch_list_episode(options = {})
|
104
|
-
get('user/watchlist/episodes').params(options).restful_params([:username]).response
|
105
|
-
end
|
106
|
-
|
107
|
-
# documentation: http://trakt.tv/api-docs/user-watchlist-movies
|
108
|
-
def watch_list_movies(options = {})
|
109
|
-
get('user/watchlist/movies').params(options).restful_params([:username]).response
|
110
|
-
end
|
111
|
-
|
112
|
-
# documentation: http://trakt.tv/api-docs/user-watchlist-shows
|
113
|
-
def watch_list_shows(options = {})
|
114
|
-
get('user/watchlist/shows').params(options).restful_params([:username]).response
|
115
|
-
end
|
116
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'integration_spec_helper'
|
2
|
-
|
3
|
-
describe TraktApi::Account do
|
4
|
-
let(:model) { TraktApi::Account.new(TraktApi::Client.new) }
|
5
|
-
|
6
|
-
describe 'real request' do
|
7
|
-
describe '.settings' do
|
8
|
-
it 'should return response class' do
|
9
|
-
model.settings.class.should == HTTParty::Response
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe '.test' do
|
14
|
-
it 'should return response class' do
|
15
|
-
model.test.class.should == HTTParty::Response
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
require 'integration_spec_helper'
|
2
|
-
|
3
|
-
describe TraktApi::Calendar do
|
4
|
-
let(:model) { TraktApi::Calendar.new(TraktApi::Client.new) }
|
5
|
-
|
6
|
-
describe 'real request' do
|
7
|
-
describe '.premieres' do
|
8
|
-
it 'should return response class' do
|
9
|
-
model.premieres.class.should == HTTParty::Response
|
10
|
-
end
|
11
|
-
|
12
|
-
describe 'with authentication' do
|
13
|
-
it 'should return response class' do
|
14
|
-
model.premieres(date: Date.today, days: 7, auth: true).class.should == HTTParty::Response
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
describe '.shows' do
|
20
|
-
it 'should return response class' do
|
21
|
-
model.shows.class.should == HTTParty::Response
|
22
|
-
end
|
23
|
-
|
24
|
-
describe 'with authentication' do
|
25
|
-
it 'should return response class' do
|
26
|
-
model.shows(date: Date.today, days: 7, auth: true).class.should == HTTParty::Response
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,173 +0,0 @@
|
|
1
|
-
require 'integration_spec_helper'
|
2
|
-
|
3
|
-
describe TraktApi::Client do
|
4
|
-
let(:client) { TraktApi::Client.new }
|
5
|
-
|
6
|
-
describe 'real request' do
|
7
|
-
describe '.account' do
|
8
|
-
describe '.settings' do
|
9
|
-
it 'should return response class' do
|
10
|
-
client.account.settings.class.should == HTTParty::Response
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
describe '.test' do
|
15
|
-
it 'should return hash' do
|
16
|
-
client.account.test.class.should == HTTParty::Response
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe '.calendar' do
|
22
|
-
describe '.premieres' do
|
23
|
-
it 'should return response class' do
|
24
|
-
client.calendar.premieres.class.should == HTTParty::Response
|
25
|
-
end
|
26
|
-
|
27
|
-
describe 'with authentication' do
|
28
|
-
it 'should return response class' do
|
29
|
-
client.calendar.premieres(date: Date.today, days: 7, auth: true).class.should == HTTParty::Response
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
describe '.shows' do
|
35
|
-
it 'should return response class' do
|
36
|
-
client.calendar.shows.class.should == HTTParty::Response
|
37
|
-
end
|
38
|
-
|
39
|
-
describe 'with authentication' do
|
40
|
-
it 'should return response class' do
|
41
|
-
client.calendar.shows(date: Date.today, days: 7, auth: true).class.should == HTTParty::Response
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
describe '.genres' do
|
48
|
-
describe '.movies' do
|
49
|
-
it 'should return response class' do
|
50
|
-
client.genres.movies.class.should == HTTParty::Response
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
describe '.shows' do
|
55
|
-
it 'should return response class' do
|
56
|
-
client.genres.shows.class.should == HTTParty::Response
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
describe '.movies' do
|
62
|
-
describe '.trending' do
|
63
|
-
it 'should return response class' do
|
64
|
-
client.movies.trending.class.should == HTTParty::Response
|
65
|
-
end
|
66
|
-
|
67
|
-
describe 'with authentication' do
|
68
|
-
it 'should return response class' do
|
69
|
-
client.movies.trending(auth: true).class.should == HTTParty::Response
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
describe '.updated' do
|
75
|
-
it 'should return response class' do
|
76
|
-
client.movies.updated(time: Time.now).class.should == HTTParty::Response
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
describe '.network' do
|
82
|
-
describe '.approve' do
|
83
|
-
it 'should return response class' do
|
84
|
-
client.network.approve(user: 'justin').class.should == HTTParty::Response
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
describe '.deny' do
|
89
|
-
it 'should return response class' do
|
90
|
-
client.network.deny(user: 'justin').class.should == HTTParty::Response
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
describe '.follow' do
|
95
|
-
it 'should return response class' do
|
96
|
-
client.network.follow(user: 'justin').class.should == HTTParty::Response
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
describe '.requests' do
|
101
|
-
it 'should return response class' do
|
102
|
-
client.network.requests.class.should == HTTParty::Response
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
describe '.unfollow' do
|
107
|
-
it 'should return response class' do
|
108
|
-
client.network.unfollow(user: 'justin').class.should == HTTParty::Response
|
109
|
-
end
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
describe '.search' do
|
114
|
-
describe '.episodes' do
|
115
|
-
it 'should return response class' do
|
116
|
-
client.search.episodes('test').class.should == HTTParty::Response
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
describe '.movies' do
|
121
|
-
it 'should return response class' do
|
122
|
-
client.search.movies('test').class.should == HTTParty::Response
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
describe '.people' do
|
127
|
-
it 'should return response class' do
|
128
|
-
client.search.people('test').class.should == HTTParty::Response
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
describe '.shows' do
|
133
|
-
it 'should return response class' do
|
134
|
-
client.search.shows('test').class.should == HTTParty::Response
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
|
-
describe '.users' do
|
139
|
-
it 'should return response class' do
|
140
|
-
client.search.users('test').class.should == HTTParty::Response
|
141
|
-
end
|
142
|
-
end
|
143
|
-
end
|
144
|
-
|
145
|
-
describe '.server' do
|
146
|
-
describe '.time' do
|
147
|
-
it 'should return response class' do
|
148
|
-
client.server.time.class.should == HTTParty::Response
|
149
|
-
end
|
150
|
-
end
|
151
|
-
end
|
152
|
-
|
153
|
-
describe '.shows' do
|
154
|
-
describe '.trending' do
|
155
|
-
it 'should return response class' do
|
156
|
-
client.shows.trending.class.should == HTTParty::Response
|
157
|
-
end
|
158
|
-
|
159
|
-
describe 'with authentication' do
|
160
|
-
it 'should return response class' do
|
161
|
-
client.shows.trending(auth: true).class.should == HTTParty::Response
|
162
|
-
end
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
|
-
describe '.updated' do
|
167
|
-
it 'should return response class' do
|
168
|
-
client.shows.updated(time: Time.now.strftime("%Y%m%d")).class.should == HTTParty::Response
|
169
|
-
end
|
170
|
-
end
|
171
|
-
end
|
172
|
-
end
|
173
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'integration_spec_helper'
|
2
|
-
|
3
|
-
describe TraktApi::Genres do
|
4
|
-
let(:model) { TraktApi::Genres.new(TraktApi::Client.new) }
|
5
|
-
|
6
|
-
describe 'real request' do
|
7
|
-
describe '.movies' do
|
8
|
-
it 'should return response class' do
|
9
|
-
model.movies.class.should == HTTParty::Response
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe '.shows' do
|
14
|
-
it 'should return response class' do
|
15
|
-
model.shows.class.should == HTTParty::Response
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'integration_spec_helper'
|
2
|
-
|
3
|
-
describe TraktApi::Movies do
|
4
|
-
let(:model) { TraktApi::Movies.new(TraktApi::Client.new) }
|
5
|
-
|
6
|
-
describe 'real request' do
|
7
|
-
describe '.trending' do
|
8
|
-
it 'should return response class' do
|
9
|
-
model.trending.class.should == HTTParty::Response
|
10
|
-
end
|
11
|
-
|
12
|
-
describe 'with authentication' do
|
13
|
-
it 'should return response class' do
|
14
|
-
model.trending(auth: true).class.should == HTTParty::Response
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
describe '.updated' do
|
20
|
-
it 'should return response class' do
|
21
|
-
model.updated(time: Time.now).class.should == HTTParty::Response
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'integration_spec_helper'
|
2
|
-
|
3
|
-
describe TraktApi::Network do
|
4
|
-
let(:model) { TraktApi::Network.new(TraktApi::Client.new) }
|
5
|
-
|
6
|
-
describe 'real request' do
|
7
|
-
describe '.approve' do
|
8
|
-
it 'should return response class' do
|
9
|
-
model.approve(user: 'justin').class.should == HTTParty::Response
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe '.deny' do
|
14
|
-
it 'should return response class' do
|
15
|
-
model.deny(user: 'justin').class.should == HTTParty::Response
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
describe '.follow' do
|
20
|
-
it 'should return response class' do
|
21
|
-
model.follow(user: 'justin').class.should == HTTParty::Response
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe '.requests' do
|
26
|
-
it 'should return response class' do
|
27
|
-
model.requests.class.should == HTTParty::Response
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
describe '.unfollow' do
|
32
|
-
it 'should return response class' do
|
33
|
-
model.unfollow(user: 'justin').class.should == HTTParty::Response
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'integration_spec_helper'
|
2
|
-
|
3
|
-
describe TraktApi::Server do
|
4
|
-
let(:model) { TraktApi::Server.new(TraktApi::Client.new) }
|
5
|
-
|
6
|
-
describe 'real request' do
|
7
|
-
describe '.time' do
|
8
|
-
it 'should return response class' do
|
9
|
-
model.time.class.should == HTTParty::Response
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|