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 ]

Wednesday January 07, 2004
01:05 AM

Congress needs SOAP

[ #16689 ]

Maybe the US Congress or Library of Congress already have SOAP interfaces to their web sites, but I have not found them, and I spent a couple hours researching a couple of bills yesterday (HR 526: Telemarketing Relief Act and HR2239: Verifiable Vote Something or Other), and what I really wanted was one link that said "Download everything related to this bill" which would include the bill text, status report, co-sponsors (with contact info), related bills, and everything else.

use Congress; # just like big companies!
 
my $congress = Congress->new;
 
my $bill = $congress->fetch( 'HR2239' );
 
print $bill->text;
 
print "Bill has ", $bill->cosponsors->count, " cosponsors\n";
 
foreach my $related ( $bill->related )
    {
    print "Related: ", $related->title, "\n";
    }
 
$bill->approve() if int( rand 2 );

But let us go even further. We need to commoditize the legislative process.

Just imagine Congress as a web service like Amazon or Google. Imagine "A page that you made" but with pending legislation, including "People insterested in this bill were also interested in these" or "Senators who voted for this bill also voted for these". Hey, once we have that, we can have real-time popularity polls right on the congressional website. The congress members would then spend a good amount of their day checking their polls like some people watch the stock ticker. "Fitzgerald up 7/8th, Daschle down 500". Since I live in Chicago, I will need "Buy votes for this bill" and "Vote again (and again)" links.

So, Ziggy, where is it? It must be there somewhere and I just have not found it.

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.
  • I was daydreaming [perl.org] along these lines myself after YAPC. Having a SOAP interface to Thomas [loc.gov] would be pretty cool--and popular I imagine.
    • I wrote to Senator Fitzgerald a while ago, and he invited me to visit him in Washington when I get back (I think he does this for everyone though). Maybe I can bring this up when I talk to him about S1980. :)
      • Cool :-) In the meantime writing a Mech agent, or something that fits into the WWW::Search framework for accessing Thomas may not be too difficult. SOAP would be a whole lot cleaner, and versatile. But...

        #!/usr/bin/perl

        use strict;
        use warnings;
        use WWW::Mechanize;

        my $bill = shift;
        if ( !$bill ) { print "usage: bill S1980\n"; exit(1); }

        my $th = WWW::Mechanize->new();
        $th->get( 'http://thomas.loc.gov' );

        $th->field( docidc108 => $bill );
        $th->submit();

        $th->follow_link( text => "GPO's PDF"

  • my $congress = Congress->new;