forevue/forummagnum-sdk

An incomplete SDK for the EA Forum / LessWrong API

dev-main 2023-06-25 12:29 UTC

This package is not auto-updated.

Last update: 2024-04-14 23:29:49 UTC


README

Tests Formats Version Total Downloads License

Installation

Requires PHP 8.2+

You can install the package via composer:

composer require forevue/forummagnum-sdk

Usage

Getting started

$client = \Forevue\ForumMagnumSdk\Client::eaForum();
// Or,
$client = \Forevue\ForumMagnumSdk\Client::lessWrong();

This SDK doesn't include any caching mechanism, but cache requests, especially resource heavy ones. Be a nice human.

Get a post

$post = $client->getPost('post-id', [
    '_id',
    'contents' => [
       'html',
    ]
]);

If you ever need more / want to contribute, a better way to do this would be to create small objects with the properties you want and hydrate them.

Testing

composer test

forummagnum-sdk was created by Félix Dorn under the * *MIT license**.