mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Update amazon usage for new apai-io version
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
<?php
|
||||
require_once realpath(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'bootstrap.php');
|
||||
|
||||
use ApaiIO\ApaiIO;
|
||||
use ApaiIO\Configuration\GenericConfiguration;
|
||||
use ApaiIO\Operations\Search;
|
||||
use ApaiIO\ApaiIO;
|
||||
use nntmux\db\DB;
|
||||
use ApaiIO\ResponseTransformer\XmlToSimpleXmlObject;
|
||||
use app\models\Settings;
|
||||
|
||||
$s = new DB();
|
||||
|
||||
$pubkey = $s->getSetting('amazonpubkey');
|
||||
$privkey = $s->getSetting('amazonprivkey');
|
||||
$asstag = $s->getSetting('amazonassociatetag');
|
||||
$pubkey = Settings::value('APIs..amazonpubkey');
|
||||
$privkey = Settings::value('APIs..amazonprivkey');
|
||||
$asstag = Settings::value('APIs..amazonassociatetag');
|
||||
|
||||
$conf = new GenericConfiguration();
|
||||
$conf
|
||||
@@ -18,15 +18,16 @@ $conf
|
||||
->setAccessKey($pubkey)
|
||||
->setSecretKey($privkey)
|
||||
->setAssociateTag($asstag)
|
||||
->setResponseTransformer('\ApaiIO\ResponseTransformer\XmlToSimpleXmlObject');
|
||||
->setResponseTransformer(XmlToSimpleXmlObject::class);
|
||||
|
||||
$search = new Search();
|
||||
$search->setCategory('VideoGames');
|
||||
$search->setKeywords('Guilty Gear 2 Oveture');
|
||||
$search->setKeywords('Deus Ex Mankind Divided');
|
||||
$search->setResponseGroup(['Large']);
|
||||
$search->setPage(1);
|
||||
|
||||
$apaiIo = new ApaiIO($conf);
|
||||
|
||||
$response = $apaiIo->runOperation($search);
|
||||
|
||||
var_dump($response);
|
||||
|
||||
Reference in New Issue
Block a user