From acef0ab5cc913a916b195c6a901258ee95d9bd6d Mon Sep 17 00:00:00 2001 From: Yaman Qalieh Date: Thu, 24 Mar 2022 20:05:05 -0400 Subject: [PATCH] [WallpaperStopBridge] Delete bridge (#2458) This website is no longer serving content --- bridges/WallpaperStopBridge.php | 106 -------------------------------- 1 file changed, 106 deletions(-) delete mode 100644 bridges/WallpaperStopBridge.php diff --git a/bridges/WallpaperStopBridge.php b/bridges/WallpaperStopBridge.php deleted file mode 100644 index a240f131..00000000 --- a/bridges/WallpaperStopBridge.php +++ /dev/null @@ -1,106 +0,0 @@ - array( - 'name' => 'Category' - ), - 's' => array( - 'name' => 'subcategory' - ), - 'm' => array( - 'name' => 'Max number of wallpapers', - 'type' => 'number', - 'defaultValue' => 20 - ), - 'r' => array( - 'name' => 'resolution', - 'exampleValue' => '1920x1200, 1680x1050,…', - 'defaultValue' => '1920x1200' - ) - )); - - public function collectData(){ - $category = $this->getInput('c'); - $subcategory = $this->getInput('s'); - $resolution = $this->getInput('r'); - - $num = 0; - $max = $this->getInput('m'); - $lastpage = 1; - - for($page = 1; $page <= $lastpage; $page++) { - $link = self::URI - . '/' - . $category - . '-wallpaper/' - . (!empty($subcategory) ? $subcategory . '-wallpaper/' : '') - . 'desktop-wallpaper-' - . $page - . '.html'; - - $html = getSimpleHTMLDOM($link); - - if($page === 1) { - preg_match('/-(\d+)\.html$/', $html->find('.pagination > .last', 0)->href, $matches); - $lastpage = min($matches[1], ceil($max / 20)); - } - - foreach($html->find('article.item') as $element) { - $wplink = $element->getAttribute('data-permalink'); - if(preg_match('%^' . self::URI . '/(.+)/([^/]+)-(\d+)\.html$%', $wplink, $matches)) { - $thumbnail = $element->find('img', 0); - - $item = array(); - $item['uri'] = self::URI - . '/wallpapers/' - . str_replace('wallpaper', 'wallpapers', $matches[1]) - . '/' - . $matches[2] - . '-' - . $resolution - . '-' - . $matches[3] - . '.jpg'; - - $item['id'] = $matches[3]; - $item['timestamp'] = time(); - $item['title'] = $thumbnail->title; - $item['content'] = $item['title'] - . '
'; - - $this->items[] = $item; - - $num++; - if ($num >= $max) - break 2; - } - } - } - } - - public function getName(){ - if(!is_null($this->getInput('s')) && !is_null($this->getInput('c')) && !is_null($this->getInput('r'))) { - $subcategory = $this->getInput('s'); - return 'WallpaperStop - ' - . $this->getInput('c') - . (!empty($subcategory) ? ' > ' . $subcategory : '') - . ' [' - . $this->getInput('r') - . ']'; - } - - return parent::getName(); - } -}