module TimesBooks::List

Public Instance Methods

getListByName(name) click to toggle source

gets individual list by name, results more recent published

# File lib/times_books/list.rb, line 5
def getListByName(name)
  url = "https://api.nytimes.com/svc/books/v3/lists.json"
  params =  { 
    list: name 
  }
  
  self.request(url, params)
end
getLists() click to toggle source

gets a summary of all lists (no book results)

# File lib/times_books/list.rb, line 15
def getLists()
  url = "https://api.nytimes.com/svc/books/v3/lists/names.json"
  params =  {}
  self.request(url, params)
end
getListsByDate(date) click to toggle source

returns complete set of published lists, including book results, for provided date

# File lib/times_books/list.rb, line 34
def getListsByDate(date)
  url = "https://api.nytimes.com/svc/books/v3/lists/overview.json"
  params = {
    published_date: date
  }
  self.request(url, params)
end
searchLists(author = '', title = '', publisher = '') click to toggle source

search for a list that contains a book with a certain author, title, or publisher

# File lib/times_books/list.rb, line 22
def searchLists(author = '', title = '', publisher = '')
  url = "https://api.nytimes.com/svc/books/v3/lists/best-sellers/history.json"
  params = {
    author: author,
    title: title,
    publisher: publisher
  }
  
  self.request(url, params)
end
searchReviews(isbn = '', title = '', author = '') click to toggle source

search for a review by book title, author, or isbn

# File lib/times_books/list.rb, line 43
def searchReviews(isbn = '', title = '', author = '')
  url = "https://api.nytimes.com/svc/books/v3/reviews.json"
  params = {
    author: author,
    title: title,
    isbn: isbn
  }
  self.request(url, params)
end