PHP code example of tmtm / habrahabr_api

1. Go to this page and download the library: Download tmtm/habrahabr_api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tmtm / habrahabr_api example snippets


    $adapter = new \Habrahabr\Api\HttpAdapter\CurlAdapter();
    $adapter->setEndpoint('API_ENDPOINT');
    $adapter->setToken('OAUTH_TOKEN');
    $adapter->setClient('OAUTH_CLIENT');
    

    $client = new Habrahabr\Api\Client($adapter);
    # Доступ к ресурсу может быть получен через метод состоящий из `get` и названия ресурса
    $User = $client->getUserResource()->getUser('me');