mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
deactivate bookcases
This commit is contained in:
@@ -28,32 +28,43 @@ class SyncOpenBooks extends Command
|
|||||||
{
|
{
|
||||||
$response = Http::post('https://openbookcase.de/api/listarea/83.08995477111446/-200.56640625000003/-38.13455657705413/221.30859375000003');
|
$response = Http::post('https://openbookcase.de/api/listarea/83.08995477111446/-200.56640625000003/-38.13455657705413/221.30859375000003');
|
||||||
|
|
||||||
|
$ids = collect($response->json()['cases'])->pluck('id');
|
||||||
|
|
||||||
foreach ($response->json()['cases'] as $case) {
|
foreach ($response->json()['cases'] as $case) {
|
||||||
BookCase::updateOrCreate(
|
try {
|
||||||
[
|
BookCase::updateOrCreate(
|
||||||
'id' => $case['id'],
|
[
|
||||||
],
|
'id' => $case['id'],
|
||||||
[
|
],
|
||||||
'title' => $case['title'],
|
[
|
||||||
'latitude' => (float)$case['lat'],
|
'id' => $case['id'],
|
||||||
'longitude' => (float)$case['lon'],
|
'title' => $case['title'],
|
||||||
'address' => $case['address'],
|
'latitude' => (float) $case['lat'],
|
||||||
'type' => $case['type'],
|
'longitude' => (float) $case['lon'],
|
||||||
'open' => $case['open'],
|
'address' => $case['address'],
|
||||||
'comment' => $case['comment'],
|
'type' => $case['type'],
|
||||||
'contact' => $case['contact'],
|
'open' => $case['open'],
|
||||||
'bcz' => $case['bcz'],
|
'comment' => $case['comment'],
|
||||||
'digital' => $case['digital'] ?? false,
|
'contact' => $case['contact'],
|
||||||
'icontype' => $case['icontype'],
|
'bcz' => $case['bcz'],
|
||||||
'deactivated' => $case['deactivated'],
|
'digital' => $case['digital'] ?? false,
|
||||||
'deactreason' => $case['deactreason'],
|
'icontype' => $case['icontype'],
|
||||||
'entrytype' => $case['entrytype'],
|
'deactivated' => $case['deactivated'],
|
||||||
'homepage' => $case['homepage'],
|
'deactreason' => $case['deactreason'],
|
||||||
'created_by' => 1,
|
'entrytype' => $case['entrytype'],
|
||||||
]
|
'homepage' => $case['homepage'],
|
||||||
);
|
'created_by' => 1,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
return Command::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Command::SUCCESS;
|
BookCase::query()
|
||||||
|
->whereNotIn('id', $ids)
|
||||||
|
->update(['deactivated' => true]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -766,5 +766,6 @@
|
|||||||
"Article already tweeted": "Artikel bereits getwittert",
|
"Article already tweeted": "Artikel bereits getwittert",
|
||||||
"Is this a news article?": "Dieser Artikel ist ein News-Artikel",
|
"Is this a news article?": "Dieser Artikel ist ein News-Artikel",
|
||||||
"Are your sure?": "Bist du dir sicher?",
|
"Are your sure?": "Bist du dir sicher?",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -763,5 +763,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -763,5 +763,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -764,5 +764,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -764,5 +764,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -764,5 +764,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -764,5 +764,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -764,5 +764,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -764,5 +764,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -726,5 +726,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -738,5 +738,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user