[ 'name' => 'Idealo.de Link to productpage', 'required' => true, 'exampleValue' => 'https://www.idealo.de/preisvergleich/OffersOfProduct/202007367_-s7-pro-ultra-roborock.html' ], 'ExcludeNew' => [ 'name' => 'Priceupdate: Do not track new items', 'type' => 'checkbox', 'value' => 'c' ], 'ExcludeUsed' => [ 'name' => 'Priceupdate: Do not track used items', 'type' => 'checkbox', 'value' => 'uc' ], 'MaxPriceNew' => [ 'name' => 'Pricealarm: Maximum price for new Product', 'type' => 'number' ], 'MaxPriceUsed' => [ 'name' => 'Pricealarm: Maximum price for used Product', 'type' => 'number' ], ] ]; public function getIcon() { return 'https://cdn.idealo.com/storage/ids-assets/ico/favicon.ico'; } public function collectData() { // Needs header with user-agent to function properly. $header = [ 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2.1 Safari/605.1.15' ]; $link = $this->getInput('Link'); $html = getSimpleHTMLDOM($link, $header); // Get Productname $titleobj = $html->find('.oopStage-title', 0); $Productname = $titleobj->find('span', 0)->plaintext; // Create product specific Cache Keys with the link $KeyNEW = $link; $KeyNEW .= 'NEW'; $KeyUSED = $link; $KeyUSED .= 'USED'; // Load previous Price $OldPriceNew = $this->loadCacheValue($KeyNEW); $OldPriceUsed = $this->loadCacheValue($KeyUSED); // First button is new. Found at oopStage-conditionButton-wrapper-text class (.) $FirstButton = $html->find('.oopStage-conditionButton-wrapper-text', 0); if ($FirstButton) { $PriceNew = $FirstButton->find('strong', 0)->plaintext; } // Second Button is used $SecondButton = $html->find('.oopStage-conditionButton-wrapper-text', 1); if ($SecondButton) { $PriceUsed = $SecondButton->find('strong', 0)->plaintext; } // Only continue if a price has changed if ($PriceNew != $OldPriceNew || $PriceUsed != $OldPriceUsed) { // Get Product Image $image = $html->find('.datasheet-cover-image', 0)->src; // Generate Content if ($PriceNew > 1) { $content = "
Price New:
$PriceNew
Price New before:
$OldPriceNew
Max Price Used:
%s,00 €
Price Used:
$PriceUsed
Price Used before:
$OldPriceUsed
Max Price Used:
%s,00 €