Example #1
0
def amazon_by_isbn(isbn):
    """ Use the ecs library to search for books by ISBN number.

  Args:
    isbn: The 10 digit ISBN number to look up.

  Returns:
    A list with a single sublist representing the book found.
    The sublist contains the book title, its lowest found
    price and its ASIN number.

  Raises:
    ValueError if the ISBN number is invalid.
  """
    ecs.setLicenseKey(license_key)
    ecs.setSecretKey(secret_key)
    ecs.setLocale('us')
    try:
        books = ecs.ItemLookup(isbn,
                               IdType='ISBN',
                               SearchIndex='Books',
                               ResponseGroup='Medium')
        return format_output(books)
    except ecs.InvalidParameterValue:
        raise ValueError('Invalid ISBN')
Example #2
0
 def amazonByISBN(self,isbn):
   ecs.setLicenseKey('11GY40BZY8FWYGMMVKG2')
   ecs.setSecretKey('4BKnT84c3U8EfpgVbTlj4+siFIQo3+TQURTHXhFx')
   ecs.setLocale('us') 
   
   books = ecs.ItemLookup(isbn, IdType='ISBN', SearchIndex='Books', ResponseGroup='Medium')
   amazon_books=self.buildResultList(books)
   return amazon_books
Example #3
0
 def searchAmazon(self,keywords):
   ecs.setLicenseKey('11GY40BZY8FWYGMMVKG2')
   ecs.setSecretKey('4BKnT84c3U8EfpgVbTlj4+siFIQo3+TQURTHXhFx')
   ecs.setLocale('us') 
   
   books = ecs.ItemSearch(keywords, SearchIndex='Books', ResponseGroup='Medium',AssociateTag='appinventoror-22')
   amazon_books=self.buildResultList(books)
   return amazon_books
    def amazonByISBN(self, isbn):
        ecs.setLicenseKey('11GY40BZY8FWYGMMVKG2')
        ecs.setSecretKey('4BKnT84c3U8EfpgVbTlj4+siFIQo3+TQURTHXhFx')
        ecs.setLocale('us')

        books = ecs.ItemLookup(isbn,
                               IdType='ISBN',
                               SearchIndex='Books',
                               ResponseGroup='Medium')
        amazon_books = self.buildResultList(books)
        return amazon_books
    def searchAmazon(self, keywords):
        ecs.setLicenseKey('11GY40BZY8FWYGMMVKG2')
        ecs.setSecretKey('4BKnT84c3U8EfpgVbTlj4+siFIQo3+TQURTHXhFx')
        ecs.setLocale('us')

        books = ecs.ItemSearch(keywords,
                               SearchIndex='Books',
                               ResponseGroup='Medium',
                               AssociateTag='appinventoror-22')
        amazon_books = self.buildResultList(books)
        return amazon_books
def amazon_by_keyword(keyword):
  """ Use the ecs library to search for books by keyword.

  Args:
    keyword: A string of keyword(s) to search for.

  Returns:
    A list of three item lists. Each sublist represents
    a result and includes the book title, its lowest found
    price and its ASIN number.
  """
  ecs.setLicenseKey(license_key)
  ecs.setSecretKey(secret_key)
  ecs.setLocale('us')

  books = ecs.ItemSearch(keyword, SearchIndex='Books', ResponseGroup='Medium')
  return format_output(books)
Example #7
0
def amazon_by_keyword(keyword):
    """ Use the ecs library to search for books by keyword.

  Args:
    keyword: A string of keyword(s) to search for.

  Returns:
    A list of three item lists. Each sublist represents
    a result and includes the book title, its lowest found
    price and its ASIN number.
  """
    ecs.setLicenseKey(license_key)
    ecs.setSecretKey(secret_key)
    ecs.setLocale('us')

    books = ecs.ItemSearch(keyword,
                           SearchIndex='Books',
                           ResponseGroup='Medium')
    return format_output(books)
def amazon_by_isbn(isbn):
  """ Use the ecs library to search for books by ISBN number.

  Args:
    isbn: The 10 digit ISBN number to look up.

  Returns:
    A list with a single sublist representing the book found.
    The sublist contains the book title, its lowest found
    price and its ASIN number.

  Raises:
    ValueError if the ISBN number is invalid.
  """
  ecs.setLicenseKey(license_key)
  ecs.setSecretKey(secret_key)
  ecs.setLocale('us')
  try:
    books = ecs.ItemLookup(isbn, IdType='ISBN', SearchIndex='Books',
                           ResponseGroup='Medium')
    return format_output(books)
  except ecs.InvalidParameterValue:
    raise ValueError('Invalid ISBN')