Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

pudge (1)

pudge
  (email not shown publicly)
http://pudge.net/
AOL IM: Crimethnk (Add Buddy, Send Message)

I run this joint, see?

Journal of pudge (1)

Wednesday February 22, 2006
12:42 AM

Political Perl

[ #28764 ]

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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Oh. My. God. The Washington State Green Party is doomed! DOOMED, I tell you!

    And if we don't have the Greens and Ralph Nader fighting for the little man, who is going to stand up and prevent the GOP from building SkyNet under the guise of voter mobilization???!?! The end is real damn nigh!

    PS: Good job. :-)
  • ... even if you are using it for Evil.
  • Too bad they outsourced the building of the Voter Vault to India, even when there were several willing companies bidding on it here in the US.

    Whatever you feel politically, at least the Democrats used a US company to build their version. And it was even done in Perl :)
    • Whatever you feel politically, at least the Democrats used a US company to build their version.

      Protectionism simply doesn't work.

      And it was even done in Perl

      That would've been nice. Also, the ability to use it without MSIE would be nice.
      • Protectionism simply doesn't work.

        I'm not saying it does. I just think it's kinda sad that a US political party doesn't show their confidence in US enterprises just to save a few bucks. If they're willing to outsource this work at the campaign level, they'll carry that same mindset to the bureaucratic positions later on.

        And I do think that a government keen on outsourcing when there's a perfectly good industry at home is a bad idea.
        • I just think it's kinda sad that a US political party doesn't show their confidence in US enterprises just to save a few bucks.

          That makes no sense to me, at all. It hurts U.S. businesses in the long run to pay them more to do work that others will do for less. Far from showing a lack of confidence, what it does is encourage them to do a better job for less money. Competition makes us all better in the long run.

          What's sad is that our economy has become so bloated that U.S. companies can't compete.

          If they'
      • >> And it was even done in Perl

        >That would've been nice. Also, the ability to use it without MSIE would be nice.

        Several years ago I worked for a political software startup and we proposed an enterprise level voter management application to the Republicans, all built in Perl and PostgreSQL. We had a really well developed product, but the cost to scale it to that level was the prohibiting factor. We had the custom report building capability that you are talking about, but getting it to run fa