2017 © Pedro Peláez
 

library reddit-api-client

Provides an interface to the API at reddit.com

image

h2s/reddit-api-client

Provides an interface to the API at reddit.com

  • Wednesday, December 2, 2015
  • by hnrysmth
  • Repository
  • 9 Watchers
  • 56 Stars
  • 632 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 26 Forks
  • 1 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Reddit API Client

Build Status Latest Stable Version Latest Stable Version Minimum PHP Version, (*1)

This is a PHP client for Reddit's API, built on the Guzzle web service client framework., (*2)

As a quick taster, here's some sample code:, (*3)

<?php
require 'vendor/autoload.php';

$clientFactory = new Reddit\Api\Client\Factory;
$client = $clientFactory->createClient();

$login = $client->getCommand(
    'Login',
    array(
        'api_type' => 'json',
        'user'     => 'Example_User',
        'passwd'   => 'password123',
    )
);
$login->execute();

$submit = $client->getCommand(
    'Submit',
    array(
        'sr'    => 'programming',
        'kind'  => 'link',
        'title' => 'Mongo DB Is Web Scale',
        'url'   => 'http://www.youtube.com/watch?v=b2F-DItXtZs',
    )
);
$submit->execute();

Installation

This project is packaged with Composer. Add the following the the require section of your project's composer.json:, (*4)

"zetaphor/reddit-api-client": "dev-master"

After that just run php composer.phar update and you're good to go! If you have any trouble, or want more detail, I've set up a working example "Reddit Console" project for reference purposes., (*5)

Development Status

Reddit's API is big, and the service description JSON in the ./api/ directory is incomplete., (*6)

Supported URIs

  • api/login/{user}
  • api/me.json
  • api/register
  • api/submit
  • api/del
  • api/vote
  • api/comment
  • api/message
  • by_id/t3_{id}.json
  • r/{subreddit}.json
  • user/{id}.json
  • user/{id}/about.json

The above list covers many of the most common interactions such as logging in, reading and posting links and comments, and casting votes. However, there are dozens more services available in Reddit's API, and simple pull requests adding entries to the service description JSON are very welcome., (*7)

Contributing

This is a fairly simple project so there aren't many guidelines. If you've fixed a bug or added a feature, let's get it merged back in. There are two hard rules., (*8)

1. Test-drive your changes

This project is test-driven. Please don't submit any code changes without a corresponding set of unit tests., (*9)

$ make phpunit

2. Follow PSR2

Stick to the PSR-2 standard., (*10)

$ make phpcs

License

This project is released under the MIT License., (*11)

The Versions

02/12 2015

dev-master

9999999-dev

Provides an interface to the API at reddit.com

  Sources   Download

GPLv2

The Requires

 

The Development Requires

api client reddit

02/12 2015

2.1

2.1.0.0

Provides an interface to the API at reddit.com

  Sources   Download

GPLv2

The Requires

 

The Development Requires

api client reddit

29/11 2013

2.0

2.0.0.0

Provides an interface to the API at reddit.com

  Sources   Download

GPLv2

The Requires

 

The Development Requires

api client reddit