From b1173df1f8e25255665c04bb5f1a990ef0412b81 Mon Sep 17 00:00:00 2001 From: Park0 Date: Wed, 18 Oct 2023 22:24:14 +0200 Subject: [PATCH] Renamed parameter 2 to sc Renamed unused method to better reflect it usage --- bridges/MarktplaatsBridge.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bridges/MarktplaatsBridge.php b/bridges/MarktplaatsBridge.php index 3863cb88bfe..ad3b59a134b 100644 --- a/bridges/MarktplaatsBridge.php +++ b/bridges/MarktplaatsBridge.php @@ -100,7 +100,7 @@ class MarktplaatsBridge extends BridgeAbstract 'required' => false, 'title' => 'Include the raw data behind the content', ], - '2' => [ + 'sc' => [ 'name' => 'Sub category', 'type' => 'number', 'required' => false, @@ -132,8 +132,8 @@ public function collectData() if (!is_null($this->getInput('c'))) { $query .= '&l1CategoryId=' . $this->getInput('c'); } - if (!is_null($this->getInput('2'))) { - $query .= '&l2CategoryId=' . $this->getInput('2'); + if (!is_null($this->getInput('sc'))) { + $query .= '&l2CategoryId=' . $this->getInput('sc'); } $url = 'https://www.marktplaats.nl/lrp/api/search?query=' . urlencode($this->getInput('q')) . $query; $jsonString = getSimpleHTMLDOM($url); @@ -186,7 +186,10 @@ public function getName() return parent::getName(); } - public static function getCategories() + /** + * Method can be used to scrape the subcategories from marktplaats + */ + public static function scrapeSubCategories() { $ids = [ '1',