Last active
December 26, 2020 09:59
-
-
Save internetztube/c8462f5789c89ffab7367638801ca263 to your computer and use it in GitHub Desktop.
#bpw16 Nachkommerstellen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// by Frederic Köberl - https://frederickoeberl.com - [email protected] | |
$url = 'http://wahltube.orf.at/bpw16stichwahl/hochrechnung.json'; | |
$document = @file_get_contents($url); | |
$document = json_decode($document); | |
$hofer = $document->hochrechnungen[0]->parteien[0]->stimmen; | |
$vdb = $document->hochrechnungen[0]->parteien[1]->stimmen; | |
$full = $hofer + $vdb; | |
$hofer = ($hofer * 100) / $full; | |
$vdb = ($vdb * 100) / $full; | |
echo "Van der Bellen: " . $vdb . "%\n"; | |
echo "Hofer: " . $hofer . "%"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment