forevue / forummagnum-sdk
An incomplete SDK for the EA Forum / LessWrong API
dev-main
2023-06-25 12:29 UTC
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.7
Requires (Dev)
- laravel/pint: ^1.10
- pestphp/pest: ^2.6
- phpstan/phpstan: ^1.10
- symfony/var-dumper: ^6
This package is not auto-updated.
Last update: 2024-04-14 23:29:49 UTC
README
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**.