summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-01-31 12:41:23 +0100
committeremkael <emkael@tlen.pl>2019-01-31 19:41:45 +0100
commita9aae4076e0068eaa3dd74b3577f0e528b3104a5 (patch)
treec88e13657dcf6cf31143bfc06c36045b51f4043b /bin
parent43b9e57aa7ec901150e60dd026cfab2ee227c45a (diff)
Deprecating FB API, motherfuckers
Diffstat (limited to 'bin')
-rw-r--r--bin/fb-user-token-expiry1
-rw-r--r--bin/fb-user-token.php38
-rwxr-xr-xbin/fb-user-token.sh3
3 files changed, 0 insertions, 42 deletions
diff --git a/bin/fb-user-token-expiry b/bin/fb-user-token-expiry
deleted file mode 100644
index d737123..0000000
--- a/bin/fb-user-token-expiry
+++ /dev/null
@@ -1 +0,0 @@
-2019-02-18 \ No newline at end of file
diff --git a/bin/fb-user-token.php b/bin/fb-user-token.php
deleted file mode 100644
index 02aea74..0000000
--- a/bin/fb-user-token.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-
-$basePath = dirname(__FILE__);
-$configFile = $basePath . '/../config/facebook.json';
-
-$expiryFile = $basePath . '/fb-user-token-expiry';
-
-if (!file_exists($expiryFile) || trim(file_get_contents($expiryFile)) == date('Y-m-d')) {
-
- $config = json_decode(file_get_contents($configFile), TRUE);
- $firstLink =
- 'https://graph.facebook.com/oauth/client_code?' .
- http_build_query([
- 'access_token' => $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;
-
- fwrite(STDERR, 'FB API token renewed, expires on: ' . date('Y-m-d H:i:s', strtotime('+' . $secondResponse->expires_in . ' seconds')) . PHP_EOL);
- file_put_contents($configFile, json_encode($config));
- file_put_contents($expiryFile, date('Y-m-d', strtotime('+' . ($secondResponse->expires_in - 1440) . ' seconds')));
-
-}
-
-?>
diff --git a/bin/fb-user-token.sh b/bin/fb-user-token.sh
deleted file mode 100755
index 396e20a..0000000
--- a/bin/fb-user-token.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-cd /srv/websites/rss.emkael.info
-php bin/fb-user-token.php