feedly-api icon indicating copy to clipboard operation
feedly-api copied to clipboard

Add support for DevTokens

Open ben-kn-app opened this issue 8 years ago • 2 comments

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.

ben-kn-app avatar Jul 04 '16 14:07 ben-kn-app

It will definitively save me some time, tks for sharing!

x011 avatar Oct 17 '17 23:10 x011

Good function!

cristianr909090 avatar Sep 04 '20 06:09 cristianr909090