From 72e457a5b7309f38140bd4837cdecda8e9a89176 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Tue, 2 Aug 2016 17:49:47 +0200 Subject: [PATCH] [Coindesk] remove bridge: website supported by Wordpress bridge --- bridges/CoinDeskBridge.php | 58 -------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 bridges/CoinDeskBridge.php diff --git a/bridges/CoinDeskBridge.php b/bridges/CoinDeskBridge.php deleted file mode 100644 index 4f9e8659..00000000 --- a/bridges/CoinDeskBridge.php +++ /dev/null @@ -1,58 +0,0 @@ -maintainer = "mitsukarenai"; - $this->name = "CoinDesk"; - $this->uri = "http://www.coindesk.com/"; - $this->description = "Returns the 5 newest posts from CoinDesk (full text)"; - $this->update = "2014-05-30"; - - } - - public function collectData(array $param) { - - function CoinDeskStripCDATA($string) { - $string = str_replace('', '', $string); - return $string; - } - function CoinDeskExtractContent($url) { - //FIXME: We need to change the $this->file_get_html to a static - $html2 = file_get_html($url); - $text = $html2->find('div.single-content', 0)->innertext; - $text = strip_tags($text, '

'); - return $text; - } - - $html = $this->file_get_html('http://www.coindesk.com/feed/atom/') or $this->returnError('Could not request CoinDesk.', 404); - $limit = 0; - - foreach($html->find('entry') as $element) { - if($limit < 5) { - $item = new \Item(); - $item->title = CoinDeskStripCDATA($element->find('title', 0)->innertext); - $item->author = $element->find('author', 0)->plaintext; - $item->uri = $element->find('link', 0)->href; - $item->timestamp = strtotime($element->find('published', 0)->plaintext); - $item->content = CoinDeskExtractContent($item->uri); - $this->items[] = $item; - $limit++; - } - } - - } - - public function getName(){ - return 'CoinDesk'; - } - - public function getURI(){ - return 'http://www.coindesk.com/'; - } - - public function getCacheDuration(){ - return 1800; // 30min - } -}