importation d'événement mobilizon unique

Fix #394
This commit is contained in:
Jean-Marie Favreau
2025-04-27 12:15:15 +02:00
parent 53ce6ad29f
commit e38d31edc8
3 changed files with 120 additions and 86 deletions

View File

@@ -24,19 +24,19 @@ from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(SimpleDownloader(), mobilizon.CExtractor())
url = "https://mobilizon.fr/@attac63/events?"
url_human = "https://mobilizon.fr/@attac63/events"
url = "https://keskonfai.fr/events/166fca9c-e758-437c-8002-9a55d822e34d"
url_human = "https://keskonfai.fr/events/166fca9c-e758-437c-8002-9a55d822e34d"
try:
events = u2e.process(
url,
url_human,
cache="cache-attac63.html",
cache="cache-single-event-mobilizon.html",
default_values={},
published=True,
)
exportfile = "events-attac63.json"
exportfile = "events-single-event-mobilizon.json"
print("Saving events to file {}".format(exportfile))
with open(exportfile, "w") as f:
json.dump(events, f, indent=4, default=str)