Stars: 121
Forks: 33
Pull Requests: 20
Issues: 12
Watchers: 15
Last Updated: 2021-03-07 19:48:47
PHP wrapper around Feedly's REST API
License: MIT License
Languages: PHP
PHP wrapper around Feedly's REST API.
Check the examples before anything.
If you are working in Sandbox mode of Feedly's API you should know a couple of things.
Add this to your composer.json
"require": {
"kbariotis/feedly-api": "dev-master"
}
Or download the ZIP.
Constructor:
$feedly = new Feedly(Mode $mode, AccessTokenStorage $accessTokenStorage);
The Mode
determines if you want to use the Sandbox mode (SandBoxMode
class) or standard one (DeveloperMode
class).
The AccessTokenStorage
determines where the information about token should be stored. In example in session, file or database.
***Sandbox Example
$feedly = new Feedly(new feedly\Mode\SandBoxMode(), new feedly\AccessTokenStorage\AccessTokenSessionStorage());
***Standard Mode Example
$feedly = new Feedly(new feedly\Mode\DeveloperMode(), new feedly\AccessTokenStorage\AccessTokenSessionStorage());
Authentication:
Check the example.
Note that not every Feedly action needs authentication. Passing a token is optional.
Endpoints
$profile = $feedly->profile();
var_dump($profile->fetch());
$profile->setOptions(array(
'email'=>'[email protected]'
));
$profile->persist();
$categories = $feedly->categories();
var_dump($categories->fetch());
$categories->changeLabel($id, 'New Label');
$categories->delete($id);
$entries = $feedly->entries();
var_dump($entries->get($id));
$streams = $feedly->streams();
//Retrieve ids from stream
var_dump($stream->get($id,"ids"));
//Retrieve contents from stream
var_dump($stream->get($id,"contents"));
$markers = $feedly->markers();
var_dump($markers->get($id));
var_dump($markers->getUnreadCount());
$markers->markArticleAsRead(array(
'TSxGHgRh4oAiHxRU9TgPrpYvYVBPjipkmUVSHGYCTY0=_14499073085:c034:d32dab1f',
'TSxGHgRh4oAiHxRU9TgPrpYvYVBPjipkmUVSHGYCTY0=_1449255d60a:22c3491:9c6d71ab'
));
$markers->markArticleAsUnread(array(
'TSxGHgRh4oAiHxRU9TgPrpYvYVBPjipkmUVSHGYCTY0=_14499073085:c034:d32dab1f',
'TSxGHgRh4oAiHxRU9TgPrpYvYVBPjipkmUVSHGYCTY0=_1449255d60a:22c3491:9c6d71ab'
));
$markers->markFeedAsUnread(array(
'feed/http://feeds.feedburner.com/design-milk'
));
$markers->markFeedAsUnread(array(
'user/c805fcbf-3acf-4302-a97e-d82f9d7c897f/category/design',
'user/c805fcbf-3acf-4302-a97e-d82f9d7c897f/category/photography'
));
phpunit
The MIT License (MIT)
Copyright (c) 2014 Konstantinos Bariotis
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.