X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fxmlhttp-cust_main-censustract.html;h=97b7f5a4c7f0199a26b3c11d30afc09b85d5886d;hb=dfba562ff61f541ba7c75f2c02b32951b73aa002;hp=9d588d7125ff99544bc5ccd85a30b326f0f36a1b;hpb=624b2d44625f69d71175c3348cae635d580c890b;p=freeside.git diff --git a/httemplate/misc/xmlhttp-cust_main-censustract.html b/httemplate/misc/xmlhttp-cust_main-censustract.html index 9d588d712..97b7f5a4c 100644 --- a/httemplate/misc/xmlhttp-cust_main-censustract.html +++ b/httemplate/misc/xmlhttp-cust_main-censustract.html @@ -36,23 +36,33 @@ if ( $sub eq 'censustract' ) { my $content = $res->content; my $p = new HTML::TokeParser \$content; my $viewstate; + my $eventvalidation; while (my $token = $p->get_tag('input') ) { - next unless $token->[1]->{name} eq '__VIEWSTATE'; - $viewstate = $token->[1]->{value}; - last; + if ($token->[1]->{name} eq '__VIEWSTATE') { + $viewstate = $token->[1]->{value}; + } + if ($token->[1]->{name} eq '__EVENTVALIDATION') { + $eventvalidation = $token->[1]->{value}; + } + last if $viewstate && $eventvalidation; } - unless ($viewstate) { + unless ($viewstate && $eventvalidation ) { - $error = "no __VIEWSTATE found"; + $error = "either no __VIEWSTATE or __EVENTVALIDATION found"; } else { my($zip5, $zip4) = split('-',$arg{zip}); + $arg{year} ||= '2011'; + #ugh workaround a mess at ffiec + $arg{year} = " $arg{year}" if $arg{year} ne '2011'; my @ffiec_args = ( __VIEWSTATE => $viewstate, + __EVENTVALIDATION => $eventvalidation, ddlbYear => $arg{year}, + ddlbYear => '2011', #' 2009', txtAddress => $arg{address}, txtCity => $arg{city}, ddlbState => $arg{state}, @@ -62,6 +72,7 @@ if ( $sub eq 'censustract' ) { warn join("\n", @ffiec_args ) if $DEBUG; + push @{ $ua->requests_redirectable }, 'POST'; $res = $ua->request( POST( $url, \@ffiec_args ) ); warn $res->as_string if $DEBUG > 1; @@ -74,6 +85,7 @@ if ( $sub eq 'censustract' ) { my @id = qw( MSACode StateCode CountyCode TractCode ); $content = $res->content; + warn $res->content if $DEBUG > 1; $p = new HTML::TokeParser \$content; my $prefix = 'UcGeoResult11_lb'; my $compare =