From 573278b81f7aff90063c373d4658502ad3733fbd Mon Sep 17 00:00:00 2001 From: mose Date: Mon, 2 Sep 2019 00:43:01 +0800 Subject: [PATCH] fix chat stats --- README.md | 2 +- scripts/generate_chat_info.py | 8 ++++---- site/data/chat.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bd038dc..5918a0e 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,6 @@ Ceci est la page d'atterrissage du site des crapauds fous. Pour bosser localement, lancez `python -m http.server` a la base du repo et puis `open http://localhost:8000` -Pour toute demande d'info passez donc sur https://coa.crapaud-fou.org et demandez dans le canal #animation-crapauds +Pour toute demande d'info passez donc sur et demandez dans le canal #animation-crapauds mose diff --git a/scripts/generate_chat_info.py b/scripts/generate_chat_info.py index 4726252..fcafa10 100644 --- a/scripts/generate_chat_info.py +++ b/scripts/generate_chat_info.py @@ -22,9 +22,9 @@ def main(): rocket = Connection() - print("Check users") - users = getAllActiveUsers(rocket) - crapauds_total = len(users) + # print("Check users") + # users = getAllActiveUsers(rocket) + # crapauds_total = len(users) print("Check channels") channels = getAllChannels(rocket) @@ -44,7 +44,7 @@ def main(): if channel_date > recent_date: channels_recent += 1 - messages = getAllMessages(rocket, channel["_id"], begindate= recent_date) + messages = getAllMessages(rocket, channel["_id"], begindate= recent_date, enddate = datetime.now()) nbMessages = len(messages) print("Check messages for channels {} ({})".format(channel['name'], nbMessages)) diff --git a/site/data/chat.json b/site/data/chat.json index 2161d16..74d630e 100644 --- a/site/data/chat.json +++ b/site/data/chat.json @@ -1 +1 @@ -{"crapauds": {"total": 2180, "recent": 98}, "canaux": {"total": 184, "recent": 107, "liste": ["semourais", "techos", "right-to-repair", "libre", "cratube", "reflexion-sur-lamour", "reflexion-sur-l-argent", "animation-crapauds", "lucarn", "empowerment"]}, "messages": {"total": 192117, "recent": 12337}, "cohortes": ["2607", "34", "barcelone", "belgique", "bourgogne", "bretagne", "centre", "grand-est", "grece", "grenoble", "hdf", "ile-de-france", "la-reunion", "loire", "lyon-st-etienne", "normandie", "paca", "paysdesavoie", "sud-ouest", "suisse"]} \ No newline at end of file +{"crapauds": {"total": 2180, "recent": 0}, "canaux": {"total": 184, "recent": 103, "liste": ["activite-et-travail", "agenda", "algoculture", "animation-crapauds", "audio-visuel-libre", "bresil", "cause-animale", "cercle-autonomie-energetique", "cercle-blockchain-crypto", "cercle-collaboratif"]}, "messages": {"total": 192177, "recent": 0}, "cohortes": ["2607", "34", "barcelone", "belgique", "bourgogne", "bretagne", "centre", "grand-est", "grece", "grenoble", "hdf", "ile-de-france", "la-reunion", "loire", "lyon-st-etienne", "normandie", "paca", "paysdesavoie", "sud-ouest", "suisse"]} \ No newline at end of file