I need a script which uses the Amazon API to return all available details of either a list of provided: ASINs, UPCs, EANs, or Keywords. The values to search will be provided in a TXT file, and the credentials and search type (ASIN, UPC, EAN or keyword) will be provided in a separate TXT file. The search output will be a new TXT file with all the available values returned from Amazon API, and the filename of the new TXT file being “yyyy-mm-dd - hh-mm – ASIN Search Results” or “yyyy-mm-dd - hh-mm – UPC Search Results” etc. This script can be done in any code of your choosing, as long as the results are as specified.
In addition to the TXT file needing to be created, I need all of the retrieved data to be added to a MySQL database. I need you to create a table for Amazon-ASIN-Details, Amazon-UPC-Details, Amazon-EAN-Details, and Amazon-Keyword-Details. Each new search results will be added to this table, with a timestamp and unique incremental key identifier for each row. mySQL credentials will be provided in the same TXT file as the AWS credentials, and search type.
There will also need to be a separate table in MySQL called Amazon-ASIN-Details which has one row per each unique ASIN, with all static details which do not change on a daily basis (name, upc, details, etc.) If an ASIN does not exist, it will need to be added to this table, and if any of the details (from the search) are different than an existing ASIN, they should be updated. There will also need to be a separate table in MySQL called Amazon-UPC-To-ASIN created, which will have each unique UPC, with a column containing how many ASINs exist for that UPC, and then a column containing the main ASIN for that UPC, and then a column containing a list of every ASIN assigned to that UPC (up1, upc2, upc3, etc.) If a UPC does not exist, it will need to be added to this table, and if any of the details (from the search) are different than an existing UPC, they should be updated. These 2 tables are different from the tables described previously (Amazon-ASIN-Details, Amazon-UPC-Details, Amazon-EAN-Details, and Amazon-Keyword-Details), as these are only updated if an entry does not exist (or if a change is made). The 4 tables per each search result will have a new row added for each search result found, along with time stamp and unique incremental identifier.