Fix amazon lookup.

This commit is contained in:
DariusIII
2016-12-05 12:50:17 +01:00
parent 7de79fff40
commit a48159e97d
3 changed files with 19 additions and 4 deletions
+5 -2
View File
@@ -4,7 +4,6 @@ require_once realpath(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR .
use ApaiIO\ApaiIO;
use ApaiIO\Configuration\GenericConfiguration;
use ApaiIO\Operations\Search;
use ApaiIO\ResponseTransformer\XmlToSimpleXmlObject;
use app\models\Settings;
@@ -13,12 +12,16 @@ $privkey = Settings::value('APIs..amazonprivkey');
$asstag = Settings::value('APIs..amazonassociatetag');
$conf = new GenericConfiguration();
$client = new \GuzzleHttp\Client();
$request = new \ApaiIO\Request\GuzzleRequest($client);
$conf
->setCountry('com')
->setAccessKey($pubkey)
->setSecretKey($privkey)
->setAssociateTag($asstag)
->setResponseTransformer(XmlToSimpleXmlObject::class);
->setRequest($request)
->setResponseTransformer(new \ApaiIO\ResponseTransformer\XmlToSimpleXmlObject());
$search = new Search();
$search->setCategory('VideoGames');