diff --git a/scripts/generate.sh b/scripts/generate.sh index 0d32d3f..2822d84 100644 --- a/scripts/generate.sh +++ b/scripts/generate.sh @@ -1,7 +1,5 @@ #!/bin/sh -pip3 install -r ./scripts/requirements.txt - # idees wget -O ./site/data/idees.json https://idees.crapaud-fou.org/stats.php @@ -12,4 +10,5 @@ wget -O ./site/data/wiki.json https://wiki.crapaud-fou.org/stats.php wget -O ./site/data/tube.json https://tube.crapaud-fou.org/feeds/videos.json?sort=-publishedAt&filter=local # chat +pip3 install -r ./scripts/requirements.txt python3 ./scripts/generate_chat_info.py diff --git a/tools/wiki/stats.php b/tools/wiki/stats.php index ef8689b..086873e 100644 --- a/tools/wiki/stats.php +++ b/tools/wiki/stats.php @@ -1,3 +1,4 @@ + $interval"); -$data['pages']['liste'] = getlist("select pageSlug, pageName from tiki_pages order by lastModif desc limit 10"); $data['photos']['total'] = getone("select count(*) from tiki_files"); $data['photos']['recent'] = getone("select count(*) from tiki_files where created > $interval"); +require_once('tiki-setup_base.php'); +$pages = $tikilib->list_pages(0, 10, 'lastModif_desc'); +foreach ($pages["data"] as $page) { + $data['pages']['liste'][$page["pageSlug"]] = $page["pageName"]; +} + header('Content-Type: application/json'); $json = json_encode( (object) $data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); @@ -62,4 +68,4 @@ if ($json === false) { $json = json_encode(array("jsonError", json_last_error_msg())); } -echo $json; +echo $json; \ No newline at end of file