From 71310d2c5a4c3b1ab5479f00f250e2a18c196b97 Mon Sep 17 00:00:00 2001 From: Dag Date: Sun, 5 Jun 2022 03:51:37 +0200 Subject: [PATCH] [OsmAndBlog] Remove bridge (#2775) They revamped their page. The feed has been returning a single item for some time. Their blog can be followed at: https://osmand.net/blog/atom.xml --- bridges/OsmAndBlogBridge.php | 63 ------------------------------------ 1 file changed, 63 deletions(-) delete mode 100644 bridges/OsmAndBlogBridge.php diff --git a/bridges/OsmAndBlogBridge.php b/bridges/OsmAndBlogBridge.php deleted file mode 100644 index d1169e2a..00000000 --- a/bridges/OsmAndBlogBridge.php +++ /dev/null @@ -1,63 +0,0 @@ -find('div.article') as $element) { - $item = array(); - - $objTitle = $element->find('h1', 0); - if (!$objTitle) - $objTitle = $element->find('h2', 0); - if (!$objTitle) - $objTitle = $element->find('h3', 0); - if ($objTitle) - $item['title'] = $objTitle->plaintext; - - $objDate = $element->find('meta[pubdate]', 0); - if ($objDate) { - $item['timestamp'] = strtotime($objDate->pubdate); - } else { - $objDate = $element->find('.date', 0); - if ($objDate) - $item['timestamp'] = strtotime($objDate->plaintext); - } - - $this->cleanupContent($element, $objTitle, $objDate, $element->find('.date', 0)); - $item['content'] = $element->innertext; - - $objLink = $html->find('.articlelinklist a', 0); - if ($objLink) { - $item['uri'] = $this->filterURL($objLink->href); - } else { - $item['uri'] = 'urn:sha1:' . hash('sha1', $item['content']); - } - - $this->items[] = $item; - } - } - - private function filterURL($url) { - if (strpos($url, '://') === false) - return self::URI . ltrim($url, '/'); - return $url; - } - - private function cleanupContent($content, ...$removeItems) { - foreach ($removeItems as $obj) { - if ($obj) $obj->outertext = ''; - } - foreach ($content->find('img') as $obj) { - $obj->src = $this->filterURL($obj->src); - } - foreach ($content->find('a') as $obj) { - $obj->href = $this->filterURL($obj->href); - $obj->target = '_blank'; - } - } -}