Changeset 2707
- Timestamp:
- May 14, 2012, 12:35:57 AM (9 years ago)
- Location:
- cpc/trunk/project
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
cpc/trunk/project/batch/presences/parse_orga_inter.pl
r2647 r2707 8 8 9 9 $url = shift; 10 $ organisme = shift;10 $deforganisme = shift; 11 11 $a->get($url); 12 12 $html = $a->content; … … 52 52 53 53 my ( $year, $month, $day ) = split /-/, $datesrange[0]; 54 return () if($year < 2000); 54 55 my ($eyear, $emonth, $eday) = split /-/, $datesrange[1]; 55 56 … … 78 79 $titre =~ s/’/'/g; 79 80 $titre =~ s/–/-/g; 81 $titre =~ s/‑/-/g; 80 82 $titre =~ s/\xc2\x92/'/g; 81 83 $titre =~ s/\xc2\x96/-/g; 82 84 @date = findDate($_); 85 $organisme = ''; 86 if($titre =~ /groupe d'amitié/i) { 87 $titre =~ s/\s+\-\s+/-/g; 88 $titre =~ s/- France/-France/gi; 89 $titre =~ s/Groupe d'amitié France \/ /Groupe d'amitié France-/gi; 90 $titre =~ s/Royaume Uni/Royaume-Uni/gi; 91 $titre =~ s/Île Maurice/Île-Maurice/gi; 92 $titre =~ s/Union des Comores/France-Comores/gi; 93 $titre =~ s/Cap Vert/Cap-Vert/gi; 94 $titre =~ s/Burkina Faso/Burkina-Faso/gi; 95 $titre =~ s/France-Union des Comores/France-Comores/gi; 96 $organisme = lc($1) if ($titre =~ /(groupe d'amitié [^:.,\( ]*) ?/i); 97 $organisme =~ s/(\S*)-france/France-$1/i; 98 } 83 99 next; 84 100 } … … 86 102 while (/fiches_id.(\d+).asp">([^<]*)<\/a>/g) { 87 103 $nom = $2; $id = $1; 104 $nom =~ s/députée?s?//; 88 105 next if ($id{$id}); 89 106 $id{$id} = 1; 90 107 $nom =~ s/ / /g; 108 $organisme = $deforganisme unless($organisme); 91 109 foreach $d (@date) { 92 110 print "{\"depute\":\"$nom\", \"id_an\":\"$id\", \"reunion\":\"$d\", \"commission\":\"$organisme\", \"source\": \"$url\", \"session\":\"$titre\"}\n"; -
cpc/trunk/project/bin/loadupdate
r2017 r2707 67 67 cd batch/jo ; perl compute_latest.pl ; cd - 68 68 fi 69 if [[ $questions -eq 2 ]]; then 70 echo International 71 echo ======================= 72 cd batch/presences ; bash load_all.sh ; cd - 73 fi 69 74 echo Hemicycles 70 75 echo ======================= … … 89 94 echo Rapports et Textes de lois 90 95 echo ========================== 91 cd batch/documents 96 cd batch/documents 92 97 if [[ $questions -eq 2 ]]; then 93 98 bash reload_latest_ppl.sh 94 99 fi 95 100 bash compute_latest.sh … … 107 112 echo ======================= 108 113 while ! php symfony load:JO ; do 114 php symfony cc --env=test --app=frontend > /dev/null 115 done; 116 fi 117 if [[ $questions -eq 2 ]]; then 118 echo load International 119 echo ======================= 120 while ! php symfony load:JO --source=international; do 109 121 php symfony cc --env=test --app=frontend > /dev/null 110 122 done; -
cpc/trunk/project/bin/updateDB5.sh
r2674 r2707 7 7 echo 'select a.id, count(tg.id) FROM tagging tg LEFT JOIN amendement a ON a.id = tg.taggable_id LEFT JOIN tag t ON t.id = tg.tag_id WHERE a.sort <> "Rectifié" AND t.triple_key = "amendement" AND taggable_model = "Amendement" group by a.id' | mysql $MYSQLID $DBNAME | grep ^[0-9] | awk '{print "UPDATE amendement SET nb_multiples = "$2" WHERE id = "$1";"}' | mysql $MYSQLID $DBNAME 8 8 9 echo 'ALTER TABLE seance CHANGE moment moment VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL' | mysql $MYSQLID $DBNAME 10 9 11 php symfony doctrine:build-model -
cpc/trunk/project/config/doctrine/schema.yml
r2678 r2707 126 126 type: enum 127 127 values: ['commission', 'hemicycle'] 128 moment: string( 30)128 moment: string(255) 129 129 organisme_id: integer 130 130 tagged: boolean -
cpc/trunk/project/lib/model/doctrine/Seance.class.php
r2609 r2707 67 67 68 68 public static function convertMoment($moment) { 69 if (strlen($moment) > 25) 70 return substr($moment, 0, 255); 69 71 if (preg_match('`(seance|séance)`i', $moment)) { 70 72 if (preg_match('`1`', $moment)) return "1ère séance"; -
cpc/trunk/project/lib/task/loadJOTask.class.php
r1237 r2707 8 8 $this->name = 'JO'; 9 9 $this->briefDescription = 'Load Présences from JO data or CRI'; 10 $this->addOption('source', null, sfCommandOption::PARAMETER_OPTIONAL, 'Define the source to load: jo or cri ', 'jo');10 $this->addOption('source', null, sfCommandOption::PARAMETER_OPTIONAL, 'Define the source to load: jo or cri or international', 'jo'); 11 11 $this->addOption('env', null, sfCommandOption::PARAMETER_OPTIONAL, 'Changes the environment this task is run in', 'test'); 12 12 $this->addOption('app', null, sfCommandOption::PARAMETER_OPTIONAL, 'Changes the environment this task is run in', 'frontend'); … … 21 21 $workdir = "commission/presents"; 22 22 $typesource = "compte-rendu"; 23 } else if ($options['source'] === "international") { 24 $workdir = "presences/json"; 25 $typesource = "international"; 23 26 } else { 24 27 echo "Error wrong value for option --source, choose cri or jo";
Note: See TracChangeset
for help on using the changeset viewer.