diff --git a/README.md b/README.md index 5387aac..888f3c9 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ example: $key = "ALJDLFJD12343"; $STATE = "WV" $stateLeagueID = "WV000" -$localLeagueIDs = "WV102|WV103|WV107|WV112" +$localLeagueIDs = "WV102|WV103|WV112" ``` ## LLAW Google Civic Information API Query version 2 @@ -40,7 +40,7 @@ This may be freely redistributed under the terms of the GNU General Public Licen google (all members with senate/delegate district query) which prints out this csv data: 'Name,Email,Phone,Address,Delegate District,Senate District,League ID,Join Date' ALL (all members without senate/delegate district query) - League ID: WV000 (members at large) WV102 (Huntington) WV103 (Morgantown-Monogalia) WV107 (Wood County) WV112 (Jefferson) + League ID: WV000 (members at large) WV102 (Huntington) WV103 (Morgantown-Monogalia) WV112 (Jefferson) 2nd argument must be the location of the LWVWV roster file, and prints out this csv information: Name,Email,Phone,Address,Join Date, diff --git a/google-civic-api.pl b/google-civic-api.pl index 9dfa256..1a7ef4f 100755 --- a/google-civic-api.pl +++ b/google-civic-api.pl @@ -129,7 +129,7 @@ foreach my $file (@files) { else { # Members At Large (MAL) file processing # League ID is assumed to be WV000 for all MALs - $leagueId = $stateLeagueID; # Default for MALs + $leagueId = $stateLeagueID; # Default for MALs ( $phone = $fields[3] ) =~ s/"//g; # Phone ( $email = $fields[4] ) =~ s/"//g; # Email ( $joinDate = $fields[10] ) =~ s/"//g; # Join Date @@ -225,6 +225,7 @@ foreach my $file (@files) { last; # Exit loop early if a match is found } } + # print Dumper($divisions); if ( $divisions && $state eq $STATE && $has_match ) { @@ -305,6 +306,10 @@ sub email { sub help { + # Construct the dynamic League ID line + my $league_id_line = "League ID: ${STATE}000 | $localLeagueIDs"; + # Replace | with spaces and remove extra spaces + $league_id_line =~ s/\s*\|\s*/ /g; my $help = "LLAW Google Civic Information API Query version 2 Copyright (C) 2025 - by Jonathan Rosenbaum This may be freely redistributed under the terms of the GNU General Public License @@ -316,14 +321,14 @@ Depending on your request, this script will process either of those files, and q generate an information file or email file. Usage: $0 google '*.csv' (queries Google Civic Api Delegate and Senate District for all LWVWV members) - $0 WV000 '*.csv' (show all information for members at large, but do not query Google) - $0 WV000 '*.csv' email (only show email addresses for members at large, but do not query Google) + $0 ${STATE}000 '*.csv' (show all information for members at large, but do not query Google) + $0 ${STATE}000 '*.csv' email (only show email addresses for members at large, but do not query Google) 1st argument can be one of these types: google (all members with senate/delegate district query) which prints out this csv data: 'Name,Email,Phone,Address,Delegate District,Senate District,League ID,Join Date' ALL (all members without senate/delegate district query) - League ID: WV000 (members at large) WV102 (Huntington) WV103 (Morgantown-Monogalia) WV107 (Wood County) WV112 (Jefferson) + $league_id_line 2nd argument must be the location of the LWVWV roster file, and prints out this csv information: Name,Email,Phone,Address,Join Date,