On ajoute de nouvelles lignes à la description depuis mobilizon

This commit is contained in:
Jean-Marie Favreau 2025-03-02 21:35:02 +01:00
parent b33f1da835
commit cdfea2e14f

View File

@ -132,11 +132,6 @@ query($preferredUsername: String!, $afterDatetime: DateTime, $page: Int) {
self.clear_events() self.clear_events()
if "@" in url: if "@" in url:
# TODO: quand on a
# https://mobilizon.fr/@xr_clermont_ferrand@mobilizon.extinctionrebellion.fr/events
# on doit retourner :
# https://mobilizon.extinctionrebellion.fr/@xr_clermont_ferrand/events
# split url to identify server url and actor id # split url to identify server url and actor id
elems = [x for x in url.split("/") if len(x) > 0 and x[0] == "@"] elems = [x for x in url.split("/") if len(x) > 0 and x[0] == "@"]
if len(elems) == 1: if len(elems) == 1:
@ -161,7 +156,7 @@ query($preferredUsername: String!, $afterDatetime: DateTime, $page: Int) {
) )
soup = BeautifulSoup(e["description"], "html.parser") soup = BeautifulSoup(e["description"], "html.parser")
description = soup.text description = soup.get_text(separator="\n")
start = ( start = (
dateutil.parser.isoparse(e["beginsOn"]) dateutil.parser.isoparse(e["beginsOn"])
.replace(tzinfo=timezone.utc) .replace(tzinfo=timezone.utc)