amazon-product-api

I don't get prices with Amazon Product Advertising API

a 夏天 提交于 2019-11-27 01:11:41
问题 I try to get prices of an ASIN number with the Amazon Product Advertising API. Code: $artNr = "B003TKSD8E"; $base_url = "http://ecs.amazonaws.de/onca/xml"; $params = array( 'AWSAccessKeyId' => self::API_KEY, 'AssociateTag' => self::API_ASSOCIATE_TAG, 'Version' => "2010-11-01", 'Operation' => "ItemLookup", 'Service' => "AWSECommerceService", 'Condition' => "All", 'IdType' => 'ASIN', 'ItemId' => $artNr); $params['Timestamp'] = gmdate("Y-m-d\TH:i:s.\\0\\0\\0\\Z", time()); $url_parts = array();

fs.writeFile in a promise, asynchronous-synchronous stuff

独自空忆成欢 提交于 2019-11-26 22:40:56
问题 I need some help with my code. I'm new at Node.js and have a lot of trouble with it. What I'm trying to do: 1) Fetch a .txt with Amazon products (ASINs) ; 2) Fetch all products using the amazon-product-api package; 3) Save each product in a .json file. My code is not working. I think I messed up with this asynchronous-synchronous stuff - help me! var amazon = require('amazon-product-api'); var fs = require('fs'); var client = amazon.createClient({ awsId: "XXX", awsSecret: "XXX", awsTag: "888"