PHP code example of her-cat / v2ex-api

1. Go to this page and download the library: Download her-cat/v2ex-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/ */

    

her-cat / v2ex-api example snippets


use HerCat\V2exApi\V2exApi;

$v2ex = new V2exApi();

$response = $v2ex->getHotTopics();

$response = $v2ex->getLatestTopics();

$response = $v2ex->getNode('python');

$response = $v2ex->getMemberByUsername('hercat');

$response = $v2ex->getMemberByID(336714);

$response = $v2ex->getMemberByUsername('hercat', false);

array|string getHotTopics(bool $format = true)
array|string getLatestTopics(bool $format = true)
array|string getNode(string $name, bool $format = true)
array|string getMemberByUsername(string $username, bool $format = true)
array|string getMemberByID(int $id, bool $format = true)
json
{
    "username":"hercat",
    "website":null,
    "github":null,
    "psn":null,
    "avatar_normal":"//cdn.v2ex.com/gravatar/16a382effadf6405b4f2923be83e8d04?s=24&d=retro",
    "bio":null,
    "url":"https://www.v2ex.com/u/hercat",
    "tagline":null,
    "twitter":null,
    "created":1532747204,
    "status":"found",
    "avatar_large":"//cdn.v2ex.com/gravatar/16a382effadf6405b4f2923be83e8d04?s=24&d=retro",
    "avatar_mini":"//cdn.v2ex.com/gravatar/16a382effadf6405b4f2923be83e8d04?s=24&d=retro",
    "location":null,
    "btc":null,
    "id":336714
}