Created
June 13, 2016 11:36
-
-
Save Xymanek/781aaf87fa9cbae73a7a89da87bad72e to your computer and use it in GitHub Desktop.
This file contains 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
Processing feeds from NY | |
JSON error: No error | |
Processing feeds from MD | |
JSON error: Syntax error |
This file contains 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 | |
function eol ($str = '') | |
{ | |
return $str . PHP_EOL; | |
} | |
$feeds = [ | |
"NY" => "https://gist.githubusercontent.com/kuanb/dbe19ce4e8ef317ee3fc/raw/8dd002cc26f7076eed84f0104bbc70eb1117b9f9/traffic-cameras.json", | |
'MD' => "https://gist.githubusercontent.com/alexwpotter/e222e644018e696ba8b60d35d285776a/raw/fa8866386c9e36f23a2153ea6e87e9b001d36c35/MDtraffic.json" | |
]; | |
foreach ($feeds as $key => $feed) { | |
echo eol('Processing feeds from '. $key); | |
$str = file_get_contents($feed); | |
json_decode($str, true); | |
echo eol('JSON error: ' . json_last_error_msg()); | |
echo eol(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment