Changeset 1575


Ignore:
Timestamp:
Oct 3, 2010, 4:32:37 PM (10 years ago)
Author:
roux
Message:

chopper le texte des questions des leur premier load ce sera mieux a priori :)

Location:
cpc/trunk/project
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/batch/questions/compute_latest.sh

    r1293 r1575  
    1616  sql_string='SELECT source FROM question_ecrite WHERE reponse = "" AND motif_retrait IS NULL'
    1717else
    18   sql_string='SELECT source FROM question_ecrite WHERE reponse = "" AND motif_retrait IS NULL AND date > DATE_SUB(CURDATE(), INTERVAL 75 DAY)'
     18  sql_string='SELECT source FROM question_ecrite WHERE question IS NULL OR (reponse = "" AND motif_retrait IS NULL AND date > DATE_SUB(CURDATE(), INTERVAL 75 DAY))'
    1919fi
    2020echo $sql_string | mysql $MYSQLID $DBNAME | grep -v source > liste_sans_reponse.txt
  • cpc/trunk/project/batch/questions/download_questions_old.pl

    r1130 r1575  
    4343print $count." questions récentes\n\n";
    4444
    45 open(FILE, 'liste_sans_reponse.txt') ;
     45open(FILE, 'liste_sans_reponse.txt');
    4646@string = <FILE>;
    4747$string = "@string";
  • cpc/trunk/project/lib/model/doctrine/QuestionEcrite.class.php

    r1495 r1575  
    4848    if (!$depute) print "ERROR: Auteur introuvable in ".$this->source." : ".$nom." // ".$sexe."\n";
    4949    else {
    50       $this->_set('Parlementaire', $depute);
     50      $this->_set('parlementaire_id', $depute->id);
    5151      $depute->free();
    5252    }
     
    6060      $ministre = preg_replace('/^([\wàéëêèïîôöûüÉ]+)[,\s].*$/', '\\1', $ministre);
    6161    }
    62     if (preg_match('/^(Affaires|Sports|Transports|Solidarités)/', $ministre)) $ministere .= 'es ';
     62    if (preg_match('/^(Aînés|Affaires|Sports|Transports|Solidarités)/', $ministre)) $ministere .= 'es ';
    6363    else if (preg_match('/^[AEÉIOU]/', $ministre)) $ministere .= 'e l\'';
    6464    else if (preg_match('/^(Famille|Santé|Coopération|Culture|Défense|Justice|Consommation|Solidarité)/', $ministre)) $ministere .= 'e la ';
  • cpc/trunk/project/lib/task/loadQuestionsTask.class.php

    r1178 r1575  
    6161              $quest->setAuteur($json->auteur);
    6262            }
    63             if ($quest->reponse === "") {
     63            if (!$quest->reponse || $quest->reponse === "") {
    6464              $quest->date = $json->date_question;
    6565              $quest->ministere = $json->ministere_interroge." / ".$json->ministere_attribue;
Note: See TracChangeset for help on using the changeset viewer.