Skip to content

Commit

Permalink
[HDWallpapers] Adapt to some website changes (Fixes #1088). Add wallp…
Browse files Browse the repository at this point in the history
…apers to enclosures, and select "HD" as the default resolution
  • Loading branch information
teromene committed Apr 7, 2019
1 parent 90bf90d commit 98c2530
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bridges/HDWallpapersBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ class HDWallpapersBridge extends BridgeAbstract {
),
'r' => array(
'name' => 'resolution',
'defaultValue' => '1920x1200',
'exampleValue' => '1920x1200, 1680x1050,…'
'defaultValue' => 'HD',
'exampleValue' => 'HD, 1920x1200, 1680x1050,…'
)
));

public function collectData(){
$category = $this->category;
$category = $this->getInput('c');
if(strrpos($category, 'wallpapers') !== strlen($category) - strlen('wallpapers')) {
$category .= '-desktop-wallpapers';
}
Expand All @@ -45,13 +45,12 @@ public function collectData(){
$thumbnail = $element->find('img', 0);

$item = array();
// http://www.hdwallpapers.in/download/yosemite_reflections-1680x1050.jpg
$item['uri'] = self::URI
. '/download'
. str_replace('wallpapers.html', $this->getInput('r') . '.jpg', $element->href);

$item['timestamp'] = time();
$item['title'] = $element->find('p', 0)->text();
$item['title'] = $element->find('em1', 0)->text();
$item['content'] = $item['title']
. '<br><a href="'
. $item['uri']
Expand All @@ -60,6 +59,7 @@ public function collectData(){
. $thumbnail->src
. '" /></a>';

$item['enclosures'] = array($item['uri']);
$this->items[] = $item;

$num++;
Expand Down

0 comments on commit 98c2530

Please sign in to comment.