feedly-api
feedly-api copied to clipboard
Add support for DevTokens
The content of this issue isn't meant to be complete, just as a quick reference for some who are looking to get this to work with a Developer Token.
In the Feedly class (Feedly.php), I have added a custom function storeDevToken (see below), it injects the developer token you can get from https://feedly.com/v3/auth/dev
public function storeDevToken($devToken) {
$response = new AccessTokenResponse(
array(
'access_token' => $devToken,
'expires_in' => (time()+(30 * 24 * 60 * 60)))
);
$this->accessTokenStorage->store($response);
return $response;
}
Then I can access the content from my account, bypassing the oauth altogether: (see above link how to get this token)
$clientSecret = "YourAccessToken";
$feedly = new feedly\Feedly(new feedly\Mode\DeveloperMode(), new feedly\AccessTokenStorage\AccessTokenSessionStorage());
$feedly->storeDevToken($clientSecret);
$model = $feedly->profile();
$response = $model->fetch();
print_r($response);
Hope it saves someone else some time.
It will definitively save me some time, tks for sharing!
Good function!