mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 17:01:16 +00:00
37 lines
967 B
PHP
37 lines
967 B
PHP
<?php
|
|
require_once dirname(__DIR__, 3) . DIRECTORY_SEPARATOR . 'bootstrap.php';
|
|
|
|
use ApaiIO\ApaiIO;
|
|
use ApaiIO\Configuration\GenericConfiguration;
|
|
use ApaiIO\Operations\Search;
|
|
use App\Models\Settings;
|
|
|
|
|
|
$pubkey = Settings::value('APIs..amazonpubkey');
|
|
$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)
|
|
->setRequest($request)
|
|
->setResponseTransformer(new \ApaiIO\ResponseTransformer\XmlToSimpleXmlObject());
|
|
|
|
$search = new Search();
|
|
$search->setCategory('VideoGames');
|
|
$search->setKeywords('Deus Ex Mankind Divided');
|
|
$search->setResponseGroup(['Large']);
|
|
$search->setPage(1);
|
|
|
|
$apaiIo = new ApaiIO($conf);
|
|
|
|
$response = $apaiIo->runOperation($search);
|
|
|
|
var_dump($response);
|