lwvwv/README.md

57 lines
3.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# League of Women Voters of West Virginia
Custom-developed software designed for the League of Women Voters of West Virginia, as well as any state or local League affiliated with the League of Women Voters.
## IMPORTANT: Format for roster
**NEW (December 2025):** MAL are now included in the Local League Membership in Your State. This makes issues with the MALspecific list irrelevant, since it is no longer required.
**NEW (July 2025):** A new column has been added to the roster for MAL. To resolve this, remove the *Middle Name* column.
**Note:** This issue appears to have been resolved in CSV files exported from [https://portal.lwv.org](https://portal.lwv.org):
The CSV file should have all fields quoted to avoid problems when a field contains an extra comma. If the file is not shipped this way, it can easily be corrected in an editor. However, the current regular expression fails if the first column is empty (`/^,/`). Until a better expression is found, the workaround is to replace all `^,/` with `"",` — this can be done in editors such as Visual Studio Code or spreadsheet tools like Calc.
## REQUIRED FILE
A file called env is required in the same directory as the program. This file may optionally include the Google API key (see [Google API credentials](https://console.cloud.google.com/apis/credentials) - restict key to the Google Civic Information API) as well as the required respective League's state, state League ID, and local Leagues IDs.
example:
```
$key = "ALJDLFJD12343";
$STATE = "WV"
$stateLeagueID = "WV000"
$localLeagueIDs = "WV102|WV103|WV112"
```
## 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
Note: Since https://portal.lwv.org came online, two csv files are now available, which should both be processed:
1. Local Leagues (Local Leagues) - which has all the local League members
2. MAL (Roster) - which has all the members at large
Depending on your request, this script will process either of those files, and query the Google Civic Information API for the Delegate and Senate Districts, generate an information file or email file.
Usage: ./google-civic-api.pl google ./roster-file (queries Google Civic Api Delegate and Senate District for all LWVWV members)
./google-civic-api.pl WV000 '*.csv' (show all information for members at large, but do not query Google)
./google-civic-api.pl WV000 '*.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) 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,
3rd argument 'email' will only print out the email addresses, and only works with the ALL or League ID type argument
You will want to send results to a file.
Example: ./google-civic-api.pl google '*.csv' > 2023-districts