http://www.aachener-zeitung.de/zva/karlo/regionAC_LTWNRW/
the political map of our region in nrw (germany) liveupdated during election …
http://www.aachener-zeitung.de/zva/karlo/regionAC_LTWNRW/
the political map of our region in nrw (germany) liveupdated during election …
Looks great! I also like the ability to compare 2017 with 2012
thx unfortunately the wrong party succeed
Good work Hans. Shame about the result.
Very cool! Can you share how you’re reading/updating live data for this doc?
for a hint check the Lounge
Great
for @all
the data is provided by csv-files.
@DBear provided a solution better then mine to read out the data and directly parse it it to json within php.
sample:
$url="http://wahlen.regioit.de/AC/LW12/05334002/html5/Landtagswahl_NRW3.csv";
$file = fopen($url,'r');
$all_rows = array();
$header = null;
while ( ($row = fgetcsv($file, 1200, ";") ) !== FALSE ) {
if ($header === null) {
$header = $row;
continue;
}
$all_rows[] = array_combine($header, $row);
}
$json = json_encode($all_rows);
print_r($json);
fclose($file);
i just did a curl to receive a string and parsed with js:
$csvUrl = $_POST['csvFile'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $csvUrl);
$agent= 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)';
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15); //time out of 15 seconds
$data = curl_exec($ch);
curl_close($ch);
regionAC_LTWNRW.hype.zip (160.7 KB)
That is great!!
I will need to reference this in 2018 here in the states
in preview of the next election here in germany i did a small update showing some additional barcharts corresponding to the hovered mapsection, click will be a deeplink to our extended resultspage …
Very nice!! That is really great work!