forked from Semantics3/semantics3-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
52 lines (35 loc) · 1.08 KB
/
test.php
File metadata and controls
52 lines (35 loc) · 1.08 KB
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
51
52
<?php
require('lib/Semantics3.php');
$key = '';
$secret = '';
$requestor = new Semantics3_Products($key,$secret);
/**
* Random Complicated Query
*
*/
$requestor->products_field("cat_id", 4992);
$requestor->products_field("brand", "Toshiba");
$requestor->products_field("name", "Portege");
$requestor->products_field("sitedetails", "name", "amazon.com");
$requestor->sitedetails("latestoffers", "price", "gte", 100);
$requestor->sitedetails("latestoffers", "currency", "USD");
$requestor->products_field("weight", "gte", 1000000);
$requestor->products_field("weight", "lt", 1500000);
$requestor->products_field("sort", "name", "desc");
echo $requestor->get_products()."\n";
$requestor->clear_query();
/**
* Sem3_ID Array Query
*
*/
$requestor->products_field("sem3_id", array("2NnNAztqoGeoQGeSya0y4K", "0xzFQX9Ss8ecMwkMy0C8Ui", "1XgtmTtMgWswmYaGS6Kgyc") );
echo $requestor->get_products()."\n";
$requestor->clear_query();
/**
* Category Query
*
*/
$requestor->categories_field("name", "hard drives");
echo $requestor->get_categories()."\n";
$requestor->clear_query();
echo "OK!\n";