newquery/hf-php-client

PHP Client for hackforums.net API

v1.1 2019-10-24 12:35 UTC

This package is auto-updated.

Last update: 2024-04-24 22:36:11 UTC


README

Hackforums API PHP Client by newQuery from the Sociopaths

Requirements

Supported endpoints

  • User info (GET /user/:id)
  • Multiple users info (GET /users/:ids)
  • Forum navigation (GET /category/:id)
  • Forum info (GET /forum/:id)
  • Thread info (GET /thread/:id)
  • Post info (GET /post/:id)
  • Private message info (GET /pm/:id)
  • List of PMs in inbox and other pm boxes (GET /pmbox/:id or GET /inbox)
  • Group info (GET /group/:id)
  • Get total of inbox (custom)

Install

composer require newquery/hf-php-client

Usage

Initialize client
<?php

require 'vendor/autoload.php';

$client = new \HFClient\Client("YOUR_API_KEY");
Get total pm
$totalInbox = $client->getTotalInbox()
Get user infos
$user = $client->getUser(2602549);
Get users infos
$users = $client->getUsers([2602549, 2015410]);
Get inbox
$user = $client->inbox();
Get thread
$thread = $client->getThread(6018226);
Get post
$post = $client->getPost(59077447);
Get group
$sociopaths = $client->getGroup(49);
Get forum
$phpSubForum = $client->getForum(154);