exileed / inoreader-api
Inoreader.com api client
1.0.0
2020-11-23 17:33 UTC
Requires
- php: ^7.3 || ^8.0
- ext-json: *
- guzzlehttp/guzzle: ^6.0 | ^7.0
Requires (Dev)
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: ~3.5
This package is auto-updated.
Last update: 2024-12-10 10:14:15 UTC
README
A PHP client for authenticating with Inoreader using OAuth and consuming the API.
Install
Via Composer
$ composer require exileed/inoreader-api
Usage
Client Example
use ExileeD\Inoreader\Inoreader; $apiKey = 1000000; $apiSecret = 'xxxx'; $token = 'ssss'; $inoreaderClient = new Inoreader( $apiKey, $apiSecret ); $inoreaderClient->setAccessToken($token); $inoreaderClient->itemsIds();
Access token via Oauth2
use ExileeD\Inoreader\Inoreader; $apiKey = 1000000; $apiSecret = 'xxxx'; $client = new Inoreader( $apiKey, $apiSecret ); $redirectUrl = 'http://localhost'; $scope = 'test'; $client->getLoginUrl($redirectUrl, $scope); $client->accessTokenFromCode('code', $redirectUrl); // Access token from refresh token $client->accessTokenFromCode('code', $redirectUrl);
Advanced usage
User info
$client->userInfo();
Add subscription
$url = 'https://www.inoreader.com/blog/feed'; $client->addSubscription($url);
Edit subscription
$url = 'feed/https://www.inoreader.com/blog/feed'; $client->editSubscription(['ac' => 'edit', 's' => $url, 't' => 'test']));
Unread count
$client->unreadCount():
Subscription list
$client->subscriptionList();
Folders and tags list
use ExileeD\Inoreader\Objects\Tag; $type = Tag::TYPE_ITEM; //$type = Tag::TYPE_TAG; //$type = Tag::TYPE_FOLDER; //$type = Tag::TYPE_ACTIVE_SEARCH; $client->tagsList($type, $count);
Testing
$ ./vendor/bin/phpunit
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.