Changeset 2531


Ignore:
Timestamp:
Dec 4, 2011, 3:10:33 PM (8 years ago)
Author:
komodo
Message:

automatize download commissions

Location:
cpc/branches/senat/project/batch/commission
Files:
3 added
2 edited

Legend:

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

    r2528 r2531  
    1414$aif = WWW::Mechanize->new();
    1515$aif->add_header('If-Modified-Since' =>  scalar(localtime(time()-3600*$since_hour))) if ($since_hour > 0);
    16 $start = shift || '0';
    17 $count = 50;
    18 $ok = 1;
    1916
    2017open FILE, "conf/cr.list";
  • cpc/branches/senat/project/batch/commission/predownload_commission.pl

    r2392 r2531  
    6666    @more = (@more, @archive);
    6767}
     68
    6869mkdir('conf') if (! -e 'conf');
     70@ignores = "";
     71if (-e 'conf/ignore.list') {
     72  open FILE, "conf/ignore.list";
     73  @ignores = <FILE>;
     74  close FILE;
     75}
     76
    6977open FILE, "> conf/cr.list";
    7078foreach $url (@more) {
    71     print FILE "$url\n";
     79  $skip = 0;
     80  foreach $ignore (@ignores) {
     81    chomp($ignore);
     82    if ($ignore eq $url) {
     83      $skip = 1;
     84      last;
     85    }
     86  }
     87  next if ($skip);
     88  print FILE "$url\n"; 
    7289}
    7390foreach $url (keys %cr) {
    74     print FILE "$url\n";
     91  $skip = 0;
     92  foreach $ignore (@ignores) {
     93    chomp($ignore);     
     94    if ($ignore eq $url) {
     95      $skip = 1;
     96      last;
     97    }
     98  }
     99  next if ($skip);
     100  print FILE "$url\n";
    75101}
    76102close FILE;
Note: See TracChangeset for help on using the changeset viewer.