[freeside-commits] freeside/httemplate/misc xmlhttp-cust_main-censustract.html, 1.2, 1.3

Jeff Finucane,420,, jeff at wavetail.420.am
Mon Aug 23 09:35:35 PDT 2010


Update of /home/cvs/cvsroot/freeside/httemplate/misc
In directory wavetail.420.am:/tmp/cvs-serv18411/httemplate/misc

Modified Files:
	xmlhttp-cust_main-censustract.html 
Log Message:
work around ffiec bug and add year 2010

Index: xmlhttp-cust_main-censustract.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/xmlhttp-cust_main-censustract.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- xmlhttp-cust_main-censustract.html	27 Jul 2009 03:26:47 -0000	1.2
+++ xmlhttp-cust_main-censustract.html	23 Aug 2010 16:35:33 -0000	1.3
@@ -36,23 +36,32 @@
     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';
+      if ($token->[1]->{name} eq '__VIEWSTATE') {
       $viewstate = $token->[1]->{value};
-      last;
+      }
+      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});
 
+      #ugh  workaround a mess at ffiec
+      $arg{year} = " $arg{year}" unless $arg{year} = "2010";
       my @ffiec_args = (
         __VIEWSTATE => $viewstate,
+        __EVENTVALIDATION => $eventvalidation,
         ddlbYear    => $arg{year},
+        ddlbYear    => ' 2009',
         txtAddress  => $arg{address},
         txtCity     => $arg{city},  
         ddlbState   => $arg{state},
@@ -62,6 +71,7 @@
       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 +84,7 @@
 
         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 =



More information about the freeside-commits mailing list