commit | author | age
|
ced309
|
1 |
<?php |
JK |
2 |
if(php_sapi_name() !== 'cli') die(); |
|
3 |
|
547b8d
|
4 |
$json = file_get_contents('http://www.ttss.krakow.pl/internetservice/geoserviceDispatcher/services/stopinfo/stops?left=-648000000&bottom=-324000000&right=648000000&top=324000000'); |
JK |
5 |
$elements = json_decode($json, 1); |
|
6 |
foreach($elements['stops'] as $element) { |
e61357
|
7 |
if($element['category'] == 'other') continue; |
547b8d
|
8 |
$stops[$element['shortName']] = $element['name']; |
ced309
|
9 |
} |
JK |
10 |
|
|
11 |
asort($stops); |
f7c4c3
|
12 |
|
JK |
13 |
echo '<?php'."\n"; |
|
14 |
echo '$stops = array ('."\n"; |
|
15 |
foreach($stops as $id => $stop) { |
|
16 |
echo ' '.str_pad($id, 4, ' ', STR_PAD_RIGHT).' => '.var_export($stop, TRUE).','."\n"; |
|
17 |
} |
|
18 |
echo ');'."\n"; |