Changeset 2607


Ignore:
Timestamp:
Jan 30, 2012, 8:38:49 AM (8 years ago)
Author:
goya
Message:

fix commissions plantées et manquantes

Location:
cpc/trunk/project/batch/commission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/batch/commission/download_commission.pl

    r2552 r2607  
    4848  push(@url, "http://www.assemblee-nationale.fr/13/cr-mec/$session/index.asp");
    4949}
     50push(@url, "http://www.assemblee-nationale.fr/13/cr-micompetitivite/10-11/index.asp");
     51push(@url, "http://www.assemblee-nationale.fr/13/cr-micompetitivite/11-12/index.asp");
     52push(@url, "http://www.assemblee-nationale.fr/13/cr-mitoxicomanie/10-11/index.asp");
     53push(@url, "http://www.assemblee-nationale.fr/13/cr-cegrippea/09-10/");
    5054
    5155$a = WWW::Mechanize->new();
  • cpc/trunk/project/batch/commission/parse_commission.pl

    r2588 r2607  
    9191$cpt = 0;
    9292sub checkout {
     93    $commission =~ s/"//g;
    9394    $cpt+=10;
    9495    $out =  '{"commission": "'.$commission.'", "intervention": "'.$intervention.'", "timestamp": "'.$cpt.'", "date": "'.$date.'", "source": "'.$source.'", "heure":"'.$heure.'", "session": "'.$session.'", ';
     
    215216foreach $line (split /\n/, $string)
    216217{
     218#print "TEST: ".$line."\n";
    217219    if ($line =~ /<h[1-9]+/i || $line =~ /"presidence"/) {
    218220      if ($line =~ /pr..?sidence de (M[^<\,]+)[<,]/i && $line !~ /sarkozy/i) {
     
    237239        if ($line =~ /<a name=["']([^"']+)["']/) {
    238240            $source = $url."#$1";
    239         }elsif($line =~ /class="menu"/ && $line =~ /<a[^>]+>([^<]+)</) {
     241        }elsif($line =~ /class="menu"/ && $line =~ /<a[^>]+>([^<]+)<?/) {
    240242            $test = $1;
    241243            if (!$commission && $test =~ /Commission|mission/) {
  • cpc/trunk/project/batch/commission/parse_presents.pl

    r1691 r2607  
    4949        return ;
    5050    }
     51    $commission =~ s/"//g;
    5152    foreach $depute (@presents) {
    5253        $depute =~ s/[\/<\|]//g;
     
    8687        if ($line =~ /<a name=["']([^"']+)["']/) {
    8788            $source = $url."#$1";
    88         }elsif($line =~/class="menu"/ && $line =~ /<a[^>]+>([^<]+)</) {
     89        }elsif($line =~/class="menu"/ && $line =~ /<a[^>]+>([^<]+)<?/) {
    8990            $test = $1;
    9091            if (!$commission && $test =~ /Commission|mission/) {
Note: See TracChangeset for help on using the changeset viewer.