organic: Add extended API

This commit is contained in:
2026-09-01 18:02:57 +02:00
parent 028c16be3d
commit 4572323a14
13 changed files with 978 additions and 266 deletions
+2 -4
View File
@@ -1,6 +1,6 @@
<?php
$url = 'https://lkv.at/at/zertifizierung/themen/BIO/zertifizierte-BIO-Betriebe.php';
$url = 'https://lkv.at/at/zertifizierung/themen/bio/zertifizierte-BIO-Betriebe.php';
header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json; charset=UTF-8');
@@ -25,8 +25,6 @@ if ($info !== '') {
exit;
}
header('Content-Type: application/json; charset=UTF-8');
$postalCode = '';
if (isset($_GET['postalCode']) && ctype_digit($_GET['postalCode'])) {
$postalCode = $_GET['postalCode'];
@@ -52,7 +50,7 @@ curl -s '$url' | grep -A3 '<tr' \
@buf = map { "\$_\n" } split /\n/, \$chunk;
} END { print for @buf; }' \
| grep -B3 -A1 --no-group-separator '"postalCode":"$postalCode' | grep -B2 -A2 --no-group-separator '"lfbisNr":$lfbisNr' \
| sed '\$s/.$//'
| sed '\$s/.$//' \
| sed 's@\s*",@",@g;s@:"\s*@:"@g'
EOF);
echo "]}\n";