organic: Add extended API
This commit is contained in:
+2
-4
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user