Skip to content

Commit 92b3cb9

Browse files
authored
Merge pull request #960 from datanfr/comptes-rendus
Create table and open file
2 parents d51fe37 + 06f721c commit 92b3cb9

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

scripts/daily.php

+32-1
Original file line numberDiff line numberDiff line change
@@ -3806,6 +3806,34 @@ public function historyPerMpsAverage()
38063806
');
38073807
}
38083808

3809+
public function debatsInfos(){
3810+
echo "historyPerMpsAverage starting \n";
3811+
3812+
// 1. Create table if not exists
3813+
$this->bdd->query("CREATE TABLE IF NOT EXISTS `debats_infos` (
3814+
`uid` INT NOT NULL,
3815+
`seanceRef` VARCHAR(75) NOT NULL,
3816+
`sessionRef` VARCHAR(75) NOT NULL,
3817+
`dateSeance` VARCHAR(75) NOT NULL,
3818+
`numSeanceJour` INT NOT NULL,
3819+
`legislature` INT NOT NULL,
3820+
`dateMaj` DATE,
3821+
PRIMARY KEY (`uid`)
3822+
) ENGINE = MyISAM;");
3823+
3824+
// 2. Download data
3825+
$file = __DIR__ . '/comptes_rendus_XVII.xml.zip';
3826+
$zip = new ZipArchive();
3827+
3828+
if ($zip->open($file) !== TRUE) {
3829+
exit("cannot open <$file>\n");
3830+
} else {
3831+
echo "file opened";
3832+
}
3833+
3834+
3835+
}
3836+
38093837
public function parrainages(){
38103838
// 1. Create table if not exists
38113839
$this->bdd->query("CREATE TABLE IF NOT EXISTS `parrainages` (
@@ -4071,7 +4099,7 @@ public function opendata_historyGroupes()
40714099
$script = new Script();
40724100
}
40734101

4074-
4102+
/*
40754103
$script->fillDeputes();
40764104
$script->addBsky();
40774105
$script->deputeAll();
@@ -4117,6 +4145,9 @@ public function opendata_historyGroupes()
41174145
$script->deputeAccordCleaned();
41184146
$script->historyMpsAverage();
41194147
$script->historyPerMpsAverage();
4148+
*/
4149+
$script->debatsInfos();
4150+
/*
41204151
//$script->parrainages(); // No longer used
41214152
$script->opendata_activeMPs();
41224153
$script->opendata_activeGroupes();

0 commit comments

Comments
 (0)