Ajout de l'importation des événements de la Coopé
This commit is contained in:
43
experimentations/get_lacoope_events.py
Executable file
43
experimentations/get_lacoope_events.py
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/python3
|
||||
# coding: utf-8
|
||||
|
||||
import os
|
||||
import json
|
||||
import sys
|
||||
|
||||
# getting the name of the directory
|
||||
# where the this file is present.
|
||||
current = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
# Getting the parent directory name
|
||||
# where the current directory is present.
|
||||
parent = os.path.dirname(current)
|
||||
|
||||
# adding the parent directory to
|
||||
# the sys.path.
|
||||
sys.path.append(parent)
|
||||
|
||||
from src.agenda_culturel.import_tasks.downloader import *
|
||||
from src.agenda_culturel.import_tasks.extractor import *
|
||||
from src.agenda_culturel.import_tasks.importer import *
|
||||
from src.agenda_culturel.import_tasks.custom_extractors import *
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
u2e = URL2Events(SimpleDownloader(), LaCoopeExtractor())
|
||||
url = "https://www.lacoope.org/concerts-calendrier/"
|
||||
url_human = "https://www.lacoope.org/concerts-calendrier/"
|
||||
|
||||
try:
|
||||
events = u2e.process(url, url_human, cache = "cache-lacoope.ical", default_values = {"category": "Concert", "location": "La Coopérative"}, published = True)
|
||||
|
||||
exportfile = "events-lacoope.json"
|
||||
print("Saving events to file {}".format(exportfile))
|
||||
with open(exportfile, "w") as f:
|
||||
json.dump(events, f, indent=4, default=str)
|
||||
except Exception as e:
|
||||
print("Exception: " + str(e))
|
29
experimentations/notes-sources.md
Normal file
29
experimentations/notes-sources.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# Notes sur les sources du territoire clermontois
|
||||
|
||||
## La Comédie de Clermont
|
||||
|
||||
URL des dates avec événements: https://lacomediedeclermont.com/saison23-24/wp-admin/admin-ajax.php?action=load_dates_existantes
|
||||
URL des informations d'une date avec paramètres en post:
|
||||
```curl --data "action=load_evenements_jour" --data "jour=2024-04-19" "https://lacomediedeclermont.com/saison23-24/wp-admin/admin-ajax.php"```
|
||||
La donnée retournée est du html assez succinct, avec l'essentiel dedans.
|
||||
|
||||
|
||||
## La coopé
|
||||
|
||||
Dans le source de https://www.lacoope.org/concerts-calendrier/ on trouve un tableau javascript qui contient les urls des événements. Ce tableau peut contenir "Gratuit" en tag. Il n'y a pas l'heure de l'événement.
|
||||
Sur chaque page événémenet, il y a :
|
||||
- meta name="description"
|
||||
- une url https://calendar.google.com/calendar/ avec la plupart des données
|
||||
|
||||
## Le caveau de la michodière
|
||||
|
||||
L'adresse https://www.lecaveaudelamichodiere.com/concerts/ donne les concerts du mois en cours.
|
||||
La page est peuplée par une requête javascript qui semble difficile à rejouer indépendamment, car on se prend un erreur 403 (fucking plugin propriétaire eventon).
|
||||
|
||||
Si on récupère l'identifiant de l'événement (type event_11377_0), on peut forger une url du type
|
||||
```https://www.lecaveaudelamichodiere.com/wp-admin/admin-ajax.php?action=eventon_ics_download&event_id=11377&ri=0``` pour récupérer un ical de l'événement.
|
||||
|
||||
## La petite gaillarde
|
||||
|
||||
Le flux RSS https://lapetitegaillarde.fr/?feed=rss2 est à peu près bien structuré.
|
||||
|
Reference in New Issue
Block a user