Skip to content

Commit

Permalink
Abandon update effort if LIS isn't available
Browse files Browse the repository at this point in the history
  • Loading branch information
waldoj committed Dec 29, 2023
1 parent 685582d commit 55cadff
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cron/legislators.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -88,14 +93,19 @@

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;
}

/*
* 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]+)\]\'><td width="190px"><a class="bioOpener" href="#">(.*?)<\/a>/m', $html, $delegates);
$tmp = array();
$i=0;
Expand Down

0 comments on commit 55cadff

Please sign in to comment.