File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ require '../src/Curl.class.php ' ;
3
+
4
+
5
+ define ('GITTIP_USERNAME ' , 'XXXXXXXXXX ' );
6
+ define ('GITTIP_API_KEY ' , 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX ' );
7
+
8
+ $ data = array (
9
+ array (
10
+ 'username ' => 'user ' . mt_rand (),
11
+ 'platform ' => 'gittip ' ,
12
+ 'amount ' => '0.02 ' ,
13
+ ),
14
+ array (
15
+ 'username ' => 'user ' . mt_rand (),
16
+ 'platform ' => 'gittip ' ,
17
+ 'amount ' => '0.02 ' ,
18
+ ),
19
+ );
20
+
21
+ $ curl = new Curl ();
22
+ $ curl ->setHeader ('Content-Type ' , 'application/json ' );
23
+ $ curl ->setBasicAuthentication (GITTIP_API_KEY );
24
+ $ curl ->post ('https://www.gittip.com/ ' . GITTIP_USERNAME . '/tips.json ' , json_encode ($ data ));
25
+
26
+ foreach ($ curl ->response as $ tip ) {
27
+ echo $ tip ->amount . ' given to ' . $ tip ->username . '. ' . "\n" ;
28
+ }
You can’t perform that action at this time.
0 commit comments