From c08f21fbcebdb0f68c370269b5dcb6ba0e0ad1e6 Mon Sep 17 00:00:00 2001 From: Hermes Date: Tue, 1 Sep 2026 14:53:04 +0200 Subject: [PATCH 1/4] new bridge: Wallapop --- bridges/WallapopBridge.php | 68 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 bridges/WallapopBridge.php diff --git a/bridges/WallapopBridge.php b/bridges/WallapopBridge.php new file mode 100644 index 00000000000..6bc79be1125 --- /dev/null +++ b/bridges/WallapopBridge.php @@ -0,0 +1,68 @@ + [ + 's' => [ + 'name' => 'search', + 'exampleValue' => 'Playstation 2', + 'required' => true + ] + ], + ]; + public function collectData() + { + $search = $this->getInput('s'); + $this->feedName = 'Search: ' . $search; + + $url = 'https://api.wallapop.com/api/v3/search/section?' + . 'keywords=' . urlencode($search) + . '&source=search_box' + . '&order_by=newest' + . '&search_country=ES' + . '§ion_type=vector_search_results'; + + $headers = [ + 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:154.0) Gecko/20100101 Firefox/154.0', + 'Accept: application/json, text/plain, */*', + 'Accept-Language: es,en-US;q=0.9,en;q=0.8', + 'Referer: https://es.wallapop.com/', + 'x-appversion: 826590', + 'deviceos: 0', + 'x-deviceos: 0', + ]; + + $response = getContents($url, $headers); + $json = json_decode($response, true); + + $items = $json['data']['section']['items'] ?? []; + + foreach ($items as $entry) { + $item = []; + + $title = $entry['title'] ?? $search; + $price = $entry['price']['amount']; + $date = intdiv($entry['created_at'], 1000); + $image_url = $entry['images'][0]['urls']['small']; + $full_desc = "
" . $entry['description']; + + $item['title'] = "$title - $price EUR"; + $item['description'] = $item['summary'] = $item['content'] = $full_desc; + $item['timestamp'] = $item['published'] = $date; + $item['link'] = $item['uri'] = "https://es.wallapop.com/item/{$entry['web_slug']}"; + $item['enclosures'] = [$entry['images'][0]['urls']['medium'] ?? $entry['images'][0]['url'] ?? '']; + + $this->items[] = $item; + } + } + public function getName() + { + return self::NAME . " " . $this->getInput("s"); + } +} From 581a6dc6395e5d5d1c4df779b71e295e834a1f49 Mon Sep 17 00:00:00 2001 From: Hermes Date: Tue, 1 Sep 2026 14:58:56 +0200 Subject: [PATCH 2/4] wallapop: fix coding style --- bridges/WallapopBridge.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/bridges/WallapopBridge.php b/bridges/WallapopBridge.php index 6bc79be1125..64b43f6e3a9 100644 --- a/bridges/WallapopBridge.php +++ b/bridges/WallapopBridge.php @@ -21,12 +21,8 @@ public function collectData() $search = $this->getInput('s'); $this->feedName = 'Search: ' . $search; - $url = 'https://api.wallapop.com/api/v3/search/section?' - . 'keywords=' . urlencode($search) - . '&source=search_box' - . '&order_by=newest' - . '&search_country=ES' - . '§ion_type=vector_search_results'; + $url = 'https://api.wallapop.com/api/v3/search/section?keywords=' . urlencode($search) . + '&source=search_box&order_by=newest&search_country=ES§ion_type=vector_search_results'; $headers = [ 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:154.0) Gecko/20100101 Firefox/154.0', @@ -63,6 +59,6 @@ public function collectData() } public function getName() { - return self::NAME . " " . $this->getInput("s"); + return self::NAME . ' ' . $this->getInput('s'); } } From 30fe551171b35d32de9a53b28b088dacfbff3dc5 Mon Sep 17 00:00:00 2001 From: Hermes Date: Tue, 1 Sep 2026 20:01:26 +0200 Subject: [PATCH 3/4] wallapop: Add maximum price parameter --- bridges/WallapopBridge.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/bridges/WallapopBridge.php b/bridges/WallapopBridge.php index 64b43f6e3a9..0e31ca2332c 100644 --- a/bridges/WallapopBridge.php +++ b/bridges/WallapopBridge.php @@ -13,12 +13,20 @@ class WallapopBridge extends BridgeAbstract 'name' => 'search', 'exampleValue' => 'Playstation 2', 'required' => true + ], + 'p' => [ + 'name' => 'price', + 'exampleValue' => 100, + 'type' => 'number', + 'required'=> false ] ], ]; public function collectData() { $search = $this->getInput('s'); + $price = $this->getInput('p'); + $this->feedName = 'Search: ' . $search; $url = 'https://api.wallapop.com/api/v3/search/section?keywords=' . urlencode($search) . @@ -40,16 +48,19 @@ public function collectData() $items = $json['data']['section']['items'] ?? []; foreach ($items as $entry) { + $itemPrice = $entry['price']['amount']; + if ($price ==! null && $itemPrice > $price) continue; + $item = []; $title = $entry['title'] ?? $search; - $price = $entry['price']['amount']; + $date = intdiv($entry['created_at'], 1000); - $image_url = $entry['images'][0]['urls']['small']; - $full_desc = "
" . $entry['description']; + $imageUrl = $entry['images'][0]['urls']['small']; + $fullDesc = "
" . $entry['description']; - $item['title'] = "$title - $price EUR"; - $item['description'] = $item['summary'] = $item['content'] = $full_desc; + $item['title'] = "$title - $itemPrice EUR"; + $item['description'] = $item['summary'] = $item['content'] = $fullDesc; $item['timestamp'] = $item['published'] = $date; $item['link'] = $item['uri'] = "https://es.wallapop.com/item/{$entry['web_slug']}"; $item['enclosures'] = [$entry['images'][0]['urls']['medium'] ?? $entry['images'][0]['url'] ?? '']; From 85613cee2e45d8502c94acec94d3a90e8e0b28ca Mon Sep 17 00:00:00 2001 From: Hermes Date: Tue, 1 Sep 2026 20:10:45 +0200 Subject: [PATCH 4/4] wallapop: Add minimum price parameter --- bridges/WallapopBridge.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/bridges/WallapopBridge.php b/bridges/WallapopBridge.php index 0e31ca2332c..4d34bcd83f1 100644 --- a/bridges/WallapopBridge.php +++ b/bridges/WallapopBridge.php @@ -14,23 +14,31 @@ class WallapopBridge extends BridgeAbstract 'exampleValue' => 'Playstation 2', 'required' => true ], - 'p' => [ - 'name' => 'price', + 'maxPrice' => [ + 'name' => 'Maximum price', 'exampleValue' => 100, 'type' => 'number', 'required'=> false + ], + 'minPrice' => [ + 'name' => 'Minimum price', + 'exampleValue' => 10, + 'type' => 'number', + 'required'=> false ] + ], ]; public function collectData() { $search = $this->getInput('s'); - $price = $this->getInput('p'); + $maxPrice = $this->getInput('maxPrice'); + $minPrice = $this->getInput('minPrice'); $this->feedName = 'Search: ' . $search; $url = 'https://api.wallapop.com/api/v3/search/section?keywords=' . urlencode($search) . - '&source=search_box&order_by=newest&search_country=ES§ion_type=vector_search_results'; + '&source=search_box&order_by=newest&search_country=ES§ion_type=vector_search_results'; $headers = [ 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:154.0) Gecko/20100101 Firefox/154.0', @@ -49,7 +57,9 @@ public function collectData() foreach ($items as $entry) { $itemPrice = $entry['price']['amount']; - if ($price ==! null && $itemPrice > $price) continue; + + if ($maxPrice !== null && $itemPrice > $maxPrice) continue; + if ($minPrice !== null && $itemPrice < $minPrice) continue; $item = [];