mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-03-14 20:21:14 +03:00
[PanneauPocketBridge] enhancements (#2940)
* [PanneauPocketBridge] small fixes * [PanneauPocketBridge] rename variable * [PanneauPocketBridge] remove function call Co-authored-by: Florent VIOLLEAU <florent.violleau@samsic.fr>
This commit is contained in:
parent
7895fa895f
commit
3ea7d46837
1 changed files with 4 additions and 4 deletions
|
@ -113,8 +113,8 @@ class PanneauPocketBridge extends BridgeAbstract
|
|||
|
||||
public function collectData()
|
||||
{
|
||||
$found = array_search($this->getInput('cities'), self::CITIES);
|
||||
$city = strtolower($this->getInput('cities') . '-' . $found);
|
||||
$matchedCity = array_search($this->getInput('cities'), self::CITIES);
|
||||
$city = strtolower($this->getInput('cities') . '-' . $matchedCity);
|
||||
$url = sprintf('https://app.panneaupocket.com/ville/%s', urlencode($city));
|
||||
|
||||
$html = getSimpleHTMLDOM($url);
|
||||
|
@ -139,14 +139,14 @@ class PanneauPocketBridge extends BridgeAbstract
|
|||
/**
|
||||
* Produce self::CITIES array
|
||||
*/
|
||||
private static function getCities()
|
||||
private static function getCities($zipcodeStartWith)
|
||||
{
|
||||
$cities = json_decode(getContents(self::URI . '/public-api/city'), true);
|
||||
|
||||
$formattedCities = null;
|
||||
$citiesString = '[<br>';
|
||||
foreach ($cities as $city) {
|
||||
if (str_starts_with($city['postCode'], '35')) {
|
||||
if (str_starts_with($city['postCode'], $zipcodeStartWith)) {
|
||||
$formattedCities[$city['name'] . ' - ' . $city['postCode']] = $city['id'];
|
||||
$citiesString .= ' "' . $city['name'] . '-' . $city['postCode'] . '" => "' . $city['id'] . '",';
|
||||
$citiesString .= '<br>';
|
||||
|
|
Loading…
Add table
Reference in a new issue