/
1.php
51 lines (41 loc) · 1.3 KB
/
1.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* Created by PhpStorm.
* User: user
* Date: 10/13/15
* Time: 12:27 PM
*/
//require 'vendor/autoload.php';
require __DIR__.'/vendor/autoload.php';
use \DTS\eBaySDK\Constants;
use \DTS\eBaySDK\Finding\Services;
use \DTS\eBaySDK\Finding\Types;
// Create the service object.
$service = new Services\FindingService([
'appId' => 'KKK6bb807-2fab-408e-aea4-9b2a2a89b87',
'globalId' => Constants\GlobalIds::DE
]);
// Create the request object.
//$request = new Types\FindItemsAdvancedRequest();
//$request = new Types\FindItemsByKeywordsRequest();
$request = new Types\FindItemsByCategoryRequest();
$request->categoryId = array('2613');
//$request->keywords = 'TV';
/*$request->itemFilter[] = new Types\ItemFilter(array(
'name' => 'MaxPrice',
'value' => array('10.00')
));*/
// Send the request to the service operation.
//$response = $service->findItemsByKeywords($request);
$response = $service->findItemsByCategory($request);
// Output the result of calling the service operation.
foreach ($response->searchResult->item as $item) {
printf("(%s) %s: %s %.2f\n",
$item->itemId,
$item->location,
$item->title,
$item->sellingStatus->currentPrice->currencyId,
$item->sellingStatus->currentPrice->value
);
echo "<img src=".$item->galleryURL."><img>";
}