Skip to content

Commit

Permalink
- fix importers (#180)
Browse files Browse the repository at this point in the history
* fix BitMobilityDataImporter.php

* fix BeamDataImporter.php

* codestyle
  • Loading branch information
AleksandraKozubal authored Dec 21, 2023
1 parent d05076b commit c2af7dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions app/Importers/BeamDataImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function extract(): static
}

$crawler = new Crawler($html);
$this->sections = $crawler->filter("div .find-beam-box");
$this->sections = $crawler->filter("div.find-beam-box");

if (count($this->sections) === 0) {
$this->createImportInfoDetails("204", self::getProviderName());
Expand All @@ -37,7 +37,7 @@ public function extract(): static

public function transform(): void
{
$url = "https://uploads-ssl.webflow.com/63c4acbedbab5dea8b1b98cd/63d8a5b60da91e7d71298637_map-vehicle-saturn.png";
$url = "https://assets-global.website-files.com/63c4acbedbab5dea8b1b98cd/63d8a5b60da91e7d71298637_map-vehicle-saturn.png";

if ($this->stopExecution) {
return;
Expand Down Expand Up @@ -73,18 +73,17 @@ public function transform(): void
$arrayOfCitiesNames = array_filter($arrayOfCitiesNames, fn($record) => strpos($record, "") === false);

foreach ($arrayOfCitiesNames as $cityName) {
if ($cityName === "Selangor") {
} else {
if ($cityName !== "Selangor") {
$cityName = trim($cityName);

if ($countryName === "Korea") {
$countryName = "South Korea";
}
$provider = $this->load($cityName, $countryName);
}

if ($provider !== "") {
$existingCityProviders[] = $provider;
if ($provider !== "") {
$existingCityProviders[] = $provider;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/Importers/BitMobilityDataImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function transform(): void
}
$existingCityProviders = [];
$crawler = new Crawler($this->html);
$this->sections = $crawler->filter(".wpb_content_element > .wpb_wrapper > p > a");
$this->sections = $crawler->filter("div.e-hotspot__tooltip");

if (count($this->sections) === 0) {
$this->createImportInfoDetails("204", self::getProviderName());
Expand Down

0 comments on commit c2af7dc

Please sign in to comment.