diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -17,9 +17,10 @@ $arr_json = json_decode($json, true); // Try to OCR the current temperature from Jersey Met's usually-more-up-to-date image... if (!exec('tesseract "https://sojpublicdata.blob.core.windows.net/jerseymet/Town/internet.Temperature1.png" stdout | grep -Eo "[-0-9]+\.[0-9]+°C"', $ocroutput, $ocrretval)) { + // ...if not, use the JSON output $curtemp = $arr_json['currentTemprature']; } else { - // ...if not, use the JSON output + // ...if so, use the OCRed output $curtemp = $ocroutput[0]; } |