Political Perl

| | Comments (0)
Voter Vault is the nationwide database of voters run by the Republicans. Chances are, if you vote in this country, you're in it.

Primarily what it's used for is contacting voters to remind them to vote, to invite them to come to events, and so on.

In Washington, most decisions -- including who gets on the ballots -- are determined by caucuses and conventions. So whoever will be the Republican candidate for the Senate this year will be decided at the state convention in May, and the delegates for that will be elected at the district caucuses, and the delegates for that will be elected at the precinct caucuses.

So, it's important.

I'm the chair of the 39th District Republicans of Snohomish County in Washington, and we have the precinct caucuses coming up in March. I want my PCOs (Precinct Committee Officers) to call all the voters in their precincts who have self-identified as Republicans (we don't register party affiliation in Washington) and who vote often (that's part of the public record).

Voter Vault has all that information and can print out nice PDFs with this information. But it is a total pain to produce these lists. There are some flexible options for printing complex reports, but few of them work if you are not running IE on Windows (and God help you if you want to actually change any of the information and you're not on Windows). And you can only run one report at a time, and you can't do batch reports, and I have over 20 PCOs, and if I have to select each precinct, one at a time, and manually select all the options I want each time, I'll go nuts. And if I made a mistake ...

So, perl. Duh.

It's a bit of a challenge because it's over SSL and you need to get a cookie and so on, but brian d foy did this work already to do something similar with SourceForge.net in Module::Release. It's the bulk of the code. Using LiveHTTPHeaders in Firefox helped a lot, to see exactly what headers were being passed around. There's also a lot of redirection going on: after clicking the NDA, I have to allow it to redirect me like five times just to get logged in.

Then I put together a simple data structure for the config options. Which party affiliation, phone or no phone, how often they vote, order (walking order, alphabetical), and so on.

I keep the PCOs in a Group in Mac OS X's Address Book. In the notes section for each PCO, I put the precinct number and name, so I just loop over the PCOs (with Mac::Glue, of course), grab the email address and precinct info for each PCO, then create the report, then download it. Then use Mac::Glue again to send the file to the PCO with Eudora.

So what could normally take probably close to an hour, now takes me about two minutes. W00t. use.perl.org

Leave a comment

<pudge/*> (pronounced "PudgeGlob") is thousands of posts over many years by Pudge.

"It is the common fate of the indolent to see their rights become a prey to the active. The condition upon which God hath given liberty to man is eternal vigilance; which condition if he break, servitude is at once the consequence of his crime and the punishment of his guilt."

About this Entry

This page contains a single entry by pudge published on February 21, 2006 9:42 PM.

Karl Rove, Boy Genius was the previous entry in this site.

I Know A Little Taliban, And There He Is is the next entry in this site.

Find recent content on the main index or look in the archives to find all content.