@@ -4,25 +4,38 @@ Reddit API Client
44[ ![ Build Status] ( https://secure.travis-ci.org/h2s/reddit-api-client.png )] ( http://travis-ci.org/h2s/reddit-api-client )
55[ ![ Scrutinizer Quality Score] ( https://scrutinizer-ci.com/g/h2s/reddit-api-client/badges/quality-score.png?s=7f14544827eccb99214c30e2f71904b527941a96 )] ( https://scrutinizer-ci.com/g/h2s/reddit-api-client/ )
66
7- This is a PHP Reddit API client.
8-
7+ This is a PHP client for [ Reddit's API] ( http://www.reddit.com/dev/api ) , built on
8+ the [ Guzzle web service client framework ] ( http://docs.guzzlephp.org/en/latest/ ) .
99
1010As a quick taster, here's some sample code:
1111
1212``` php
1313<?php
1414require 'vendor/autoload.php';
1515
16- $clientFactory = new RedditApiClient\ClientFactory ;
16+ $clientFactory = new Reddit\Api\Client\Factory ;
1717$client = $clientFactory->createClient();
1818
19- $login = $client->getCommand('Login', array(
20- 'api_type' => 'json',
21- 'user' => 'Example_User',
22- 'passwd' => 'password123',
23- ));
24-
25- $response = $login->execute();
19+ $login = $client->getCommand(
20+ 'Login',
21+ array(
22+ 'api_type' => 'json',
23+ 'user' => 'Example_User',
24+ 'passwd' => 'password123',
25+ )
26+ );
27+ $login->execute();
28+
29+ $submit = $client->getCommand(
30+ 'Submit',
31+ array(
32+ 'sr' => 'programming',
33+ 'kind' => 'link',
34+ 'title' => 'Mongo DB Is Web Scale',
35+ 'url' => 'http://www.youtube.com/watch?v=b2F-DItXtZs',
36+ )
37+ );
38+ $submit->execute();
2639```
2740
2841Installation
0 commit comments