Class: Yify::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/yify/client.rb

Instance Method Summary collapse

Instance Method Details

#add_movie_bookmark(params) ⇒ Object

POST

add_movie_bookmark

See: yts.to/api#add_movie_bookmark

Get all the current movies which have been bookmarked for a given user



286
287
288
289
# File 'lib/yify/client.rb', line 286

def add_movie_bookmark(params)
  data = self.class.post("/add_movie_bookmark", { body: params })
  Yify::Response.new(data, :bookmark)
end

#delete_comment(params) ⇒ Object

POST

delete_comment

See: yts.to/api#delete_comment

Delete a comment on a movie



372
373
374
375
# File 'lib/yify/client.rb', line 372

def delete_comment(params)
  data = self.class.post("/delete_comment", { body: params })
  Yify::Response.new(data, :api_response)
end

#delete_movie_bookmark(params) ⇒ Object

POST

delete_movie_bookmark

See: yts.to/api#delete_movie_bookmark

remove movies from the user’s bookmarks



303
304
305
306
# File 'lib/yify/client.rb', line 303

def delete_movie_bookmark(params)
  data = self.class.post("/delete_movie_bookmark", { body: params })
  Yify::Response.new(data, :api_response)
end

#get_movie_bookmarks(params) ⇒ Object

GET

get_movie_bookmarks

See: yts.to/api#get_movie_bookmarks

Get all the current movies which have been bookmarked for a given user



269
270
271
272
# File 'lib/yify/client.rb', line 269

def get_movie_bookmarks(params)
  data = self.class.get("/get_movie_bookmarks", { query: params })
  Yify::Response.new(data, :bookmarks)
end

#like_comment(params) ⇒ Object

POST

like_comment

See: yts.to/api#like_comment

Like a comment on a movie



338
339
340
341
# File 'lib/yify/client.rb', line 338

def like_comment(params)
  data = self.class.post("/like_comment", { body: params })
  Yify::Response.new(data, :api_response)
end

#like_movie(params) ⇒ Object

POST

like_movie

See: yts.to/api#like_movie

Reset the users’ password.



253
254
255
256
# File 'lib/yify/client.rb', line 253

def like_movie(params)
  data = self.class.post("/like_movie", { body: params })
  Yify::Response.new(data, :api_response)
end

#list_movies(params) ⇒ Object

GET

list_movies

See: yts.to/api#list_movies

Get a list of movies, this method can be used to search or filter.



28
29
30
31
# File 'lib/yify/client.rb', line 28

def list_movies(params)
  data = self.class.get("/list_movies", { query: params })
  Yify::Response.new(data, :movies)
end

#list_upcomingObject

GET

list_upcoming

See: yts.to/api#list_upcoming

A list of all upcoming movies.



117
118
119
120
# File 'lib/yify/client.rb', line 117

def list_upcoming
  data = self.class.get("/list_upcoming")
  Yify::Response.new(data, :upcoming_movies)
end

#make_comment(params) ⇒ Object

POST

make_comment

See: yts.to/api#make_comment

Add comment to a movie.



321
322
323
324
# File 'lib/yify/client.rb', line 321

def make_comment(params)
  data = self.class.post("/make_comment", { body: params })
  Yify::Response.new(data, :api_response)
end

#make_request(params) ⇒ Object

POST

make_request

See: yts.to/api#make_request

Request a movie to be added to Yify.



390
391
392
393
# File 'lib/yify/client.rb', line 390

def make_request(params)
  data = self.class.post("/make_request", { body: params })
  Yify::Response.new(data, :api_response)
end

#movie_comments(movie_id) ⇒ Object

GET

movie_comments

See: yts.to/api#movie_comments

Get comments for the desired movie



75
76
77
78
# File 'lib/yify/client.rb', line 75

def movie_comments(movie_id)
  data = self.class.get("/movie_comments", { query: { movie_id: movie_id } })
  Yify::Response.new(data, :comments)
end

#movie_details(params) ⇒ Object

GET

movie_details

See: yts.to/api#movie_details

Get movie details.



45
46
47
48
# File 'lib/yify/client.rb', line 45

def movie_details(params)
  data = self.class.get("/movie_details", { query: params })
  Yify::Response.new(data, :movie)
end

#movie_parental_guides(movie_id) ⇒ Object

GET

movie_parental_guides

See: yts.to/api#movie_parental_guides

Get parental guides for the desired movie



105
106
107
108
# File 'lib/yify/client.rb', line 105

def movie_parental_guides(movie_id)
  data = self.class.get("/movie_parental_guides", { query: { movie_id: movie_id } })
  Yify::Response.new(data, :parental_guides)
end

#movie_reviews(movie_id) ⇒ Object

GET

movie_reviews

See: yts.to/api#movie_reviews

Get reviews for the desired movie



90
91
92
93
# File 'lib/yify/client.rb', line 90

def movie_reviews(movie_id)
  data = self.class.get("/movie_reviews", { query: { movie_id: movie_id } })
  Yify::Response.new(data, :reviews)
end

#movie_suggestions(movie_id) ⇒ Object

GET

movie_suggestions

See: yts.to/api#movie_suggestions

Returns 4 related movies as suggestions for the user



60
61
62
63
# File 'lib/yify/client.rb', line 60

def movie_suggestions(movie_id)
  data = self.class.get("/movie_suggestions", { query: { movie_id: movie_id } })
  Yify::Response.new(data, :movie_suggestions)
end

#report_comment(params) ⇒ Object

POST

report_comment

See: yts.to/api#report_comment

Report a comment on a movie



355
356
357
358
# File 'lib/yify/client.rb', line 355

def report_comment(params)
  data = self.class.post("/report_comment", { body: params })
  Yify::Response.new(data, :api_response)
end

#user_details(params) ⇒ Object

GET

user_details

See: yts.to/api#user_details

Get desired users’ details.



133
134
135
136
# File 'lib/yify/client.rb', line 133

def user_details(params)
  data = self.class.get("/user_details", { query: params })
  Yify::Response.new(data, :user)
end

#user_edit_settings(params) ⇒ Object

POST

user_edit_settings

See: yts.to/api#user_edit_settings

update a logged in user’s profile.



185
186
187
188
# File 'lib/yify/client.rb', line 185

def user_edit_settings(params)
  data = self.class.post("/user_edit_settings", { body: params })
  Yify::Response.new(data, :user)
end

#user_forgot_password(params) ⇒ Object

POST

user_forgot_password

yts.to/api#user_forgot_password

Send a password reset email to the specified email address.



219
220
221
222
# File 'lib/yify/client.rb', line 219

def user_forgot_password(params)
  data = self.class.post("/user_forgot_password", { body: params })
  Yify::Response.new(data, :api_response)
end

#user_get_key(params) ⇒ Object

POST

get_user_key

See: yts.to/api#get_user_key

The same as logging in, if successful the returned data will include the user_key for later use of the API as a means of authentication



151
152
153
154
# File 'lib/yify/client.rb', line 151

def user_get_key(params)
  data = self.class.post("/user_get_key", { body: params })
  Yify::Response.new(data, :session)
end

#user_profile(user_key) ⇒ Object

GET

user_profile

See: yts.to/api#user_profile

Get a logged in user’s profile.



166
167
168
169
# File 'lib/yify/client.rb', line 166

def (user_key)
  data = self.class.get("/user_profile", { query: { user_key: user_key } })
  Yify::Response.new(data, :user)
end

#user_register(params) ⇒ Object

POST

user_register

See: yts.to/api#user_register

Register a new user with Yify.



203
204
205
206
# File 'lib/yify/client.rb', line 203

def user_register(params)
  data = self.class.post("/user_register", { body: params })
  Yify::Response.new(data, :session)
end

#user_reset_password(params) ⇒ Object

POST

user_reset_password

See: yts.to/api#user_reset_password

Reset the users’ password.



236
237
238
239
# File 'lib/yify/client.rb', line 236

def user_reset_password(params)
  data = self.class.post("/user_reset_password", { body: params })
  Yify::Response.new(data, :session)
end