-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.php
39 lines (31 loc) · 1.49 KB
/
index.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
<?php
ini_set("display_errors","1");
ERROR_REPORTING(E_ALL);
require_once('etsy_api.php');
/*A set of options may be passed in with only one being required
* REQUIRED = etsy_key
* This is the api key given to you by etsy used to verify your account defaults to "null"
*
* Optional
* base_url = may be set manually, defaults to v1
* cache = turn caching on or off, defaults to false
* ttl = ammount of time cache should last written in english (ie "+1 hour", "+1 day"); defaults to "+1 hour"
* tmp_dir = directory to which your cache file can be written must be writable by the server; defaults to "/tmp/"
*/
$options = array(
'etsy_key' => 'your_key_here',
'cache' => true,
'tmp_dir' => 'tmp',
'ttl' => "+1 minute"
);
$etsy = new Etsy($options);
/* building an etsy request is easy just supply four things
* - section of etsy name (ie: users, listings, shops, etc...)
* - function you would like to call, tried to hold naming convention by using the method name
* without the "getName" part at the beginning. (ie: getUsersByName = byName)
* - array of options, these are the options available in the etsy method, exactly as they are written there
* - json true/false, whether you would like a json string(true) or a php json obj (false)
*/
$test = $etsy->request('listings', 'allListings', array('limit' => 5), false);
var_dump($test);
?>