From a9aae4076e0068eaa3dd74b3577f0e528b3104a5 Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 31 Jan 2019 12:41:23 +0100 Subject: Deprecating FB API, motherfuckers --- providers/Facebook.php | 76 -------------------------------------------------- 1 file changed, 76 deletions(-) delete mode 100644 providers/Facebook.php (limited to 'providers') diff --git a/providers/Facebook.php b/providers/Facebook.php deleted file mode 100644 index 013781b..0000000 --- a/providers/Facebook.php +++ /dev/null @@ -1,76 +0,0 @@ -_config = json_decode(file_get_contents('../config/facebook.json'), TRUE); - $this->_api = new \Facebook\Facebook($this->_config); - } - - protected function _getCachePath() { - return '../cache/facebook.%s'; - } - - protected function _fetchItems() { - $request = new \Facebook\FacebookRequest( - $this->_api->getApp(), - $this->_config['user_token'], - 'GET', - sprintf('/%s/posts', $this->_feed) - ); - $data = $this->_api->getClient()->sendRequest($request)->getDecodedBody()['data']; - return $data; - } - - protected function _spamFilter($items) { - return $items; - } - - protected function _mapItems($content) { - return array_map( - function($i) { - $item = new Item(); - $item->ID = $i['id']; - $item->Title = str_replace( - "\n", ' ', - isset($i['story']) ? $i['story'] : ( - isset($i['message']) ? $i['message'] : $i['id'] - ) - ); - $item->Link = sprintf( - 'https://facebook.com/%s', - $i['id'] - ); - $item->Text = nl2br( - isset($i['message']) ? $i['message'] : ( - isset($i['story']) ? $i['story'] : $i['id'] - ) - ); - $item->Time = strtotime($i['created_time']); - return $item; - }, $content - ); - } - - protected function _sortContent($content) { - return $content; - } - - public function title() { - return sprintf("%s's Facebook page posts", $this->_feed); - } - -} - -?> -- cgit v1.2.3