Skip to content

Commit

Permalink
[IdealoBridge] added Header with user-agent and fixed typo (#3897)
Browse files Browse the repository at this point in the history
* Added header with useragent

* copy paste error from local test environment

* Fixed missing space in New before

* fixed missing space after comma in argument list
  • Loading branch information
SebLaus authored Jan 19, 2024
1 parent 6eaf0ea commit 6408123
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bridges/IdealoBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ public function getIcon()

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);
$html = getSimpleHTMLDOM($link, $header);

// Get Productname
$titleobj = $html->find('.oopStage-title', 0);
Expand Down Expand Up @@ -80,7 +85,7 @@ public function collectData()
// Generate Content
if ($PriceNew > 1) {
$content = "<p><b>Price New:</b><br>$PriceNew</p>";
$content .= "<p><b>Price Newbefore:</b><br>$OldPriceNew</p>";
$content .= "<p><b>Price New before:</b><br>$OldPriceNew</p>";
}

if ($this->getInput('MaxPriceNew') != '') {
Expand Down

0 comments on commit 6408123

Please sign in to comment.