diff --git a/cron/legislators.php b/cron/legislators.php index 85b09a5..78c58fe 100644 --- a/cron/legislators.php +++ b/cron/legislators.php @@ -73,6 +73,11 @@ */ $html = get_content('https://lis.virginia.gov/241/mbr/MBR.HTM'); +if ($html == false) +{ + $log->put('Could not load Senate listing. Abandoning efforts.', 5); + return; +} preg_match_all('/mbr\+S([0-9]{2,3})">(.+)<\/a>/', $html, $senators); $tmp = array(); $i=0; @@ -88,7 +93,7 @@ if (count($senators) < 35) { - $log->put('Since too few senators were found to be plausible, abandoning efforts.', 5); + $log->put('Since too few senators were found to be plausible. Abandoning efforts.', 5); return; } @@ -96,6 +101,11 @@ * Get delegates. Their House ID (e.g., "H0200") is the key, their name is the value. */ $html = get_content('https://virginiageneralassembly.gov/house/members/members.php?ses=' . SESSION_YEAR); +if ($html == false) +{ + $log->put('Could not load Senate listing. Abandoning efforts.', 5); + return; +} preg_match_all('/id=\'member\[H([0-9]+)\]\'>