From c66fb8ec9eba761da8800134cc80733e1bf7a22b Mon Sep 17 00:00:00 2001 From: emkael Date: Mon, 16 Jan 2017 23:52:38 +0100 Subject: * script to renew FB user token --- bin/fb-user-token.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 bin/fb-user-token.php (limited to 'bin/fb-user-token.php') diff --git a/bin/fb-user-token.php b/bin/fb-user-token.php new file mode 100644 index 0000000..c78abfc --- /dev/null +++ b/bin/fb-user-token.php @@ -0,0 +1,30 @@ + $config['user_token'], + 'client_id' => $config['app_id'], + 'client_secret' => $config['app_secret'], + 'redirect_uri' => 'http://rss.emkael.info/facebook.php' + ]); +$firstResponse = json_decode(file_get_contents($firstLink)); + +$secondLink = + 'https://graph.facebook.com/oauth/access_token?' . + http_build_query([ + 'client_id' => $config['app_id'], + 'code' => $firstResponse->code, + 'redirect_uri' => 'http://rss.emkael.info/facebook.php' + ]); +$secondResponse = json_decode(file_get_contents($secondLink)); + +$config['user_token'] = $secondResponse->access_token; + +print json_encode($config); + +?> -- cgit v1.2.3