Clean du code grâce à ruff

This commit is contained in:
Jean-Marie Favreau
2025-03-02 19:12:50 +01:00
parent d8c4c55c44
commit b5d4c0f0b1
225 changed files with 3748 additions and 1790 deletions

View File

@@ -13,4 +13,3 @@ parser.add_simple_formatter("vc_raw_html", "")
plain_txt = parser.format(text)
print(plain_txt)

View File

@@ -1,40 +1,42 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
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
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
sys.path.append(parent + "/src")
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 *
from src.agenda_culturel.import_tasks.custom_extractors import (
amisdutempsdescerises,
)
from src.agenda_culturel.import_tasks.downloader import SimpleDownloader
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(SimpleDownloader(), amisdutempsdescerises.CExtractor())
url = "https://amisdutempsdescerises.org/page.php"
url_human = "https://amisdutempsdescerises.org/"
try:
events = u2e.process(url, url_human, cache = "cache-amiscerices.xml", default_values = {"category": "Rencontres & Débats"}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-amiscerices.xml",
default_values={"category": "Rencontres & Débats"},
published=True,
)
exportfile = "events-amiscerices.json"
print("Saving events to file {}".format(exportfile))

View File

@@ -1,37 +1,42 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
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
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
sys.path.append(parent + "/src")
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 *
from src.agenda_culturel.import_tasks.custom_extractors import arachnee
from src.agenda_culturel.import_tasks.downloader import (
ChromiumHeadlessDownloader,
)
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(ChromiumHeadlessDownloader(), arachnee.CExtractor())
url = "https://www.arachnee-concerts.com/wp-admin/admin-ajax.php?action=movies-filter&per_page=9999&date=NaN.NaN.NaN&theatres=Clermont-Fd&cat=&sorting=&list_all_events=&current_page="
url_human = "https://www.arachnee-concerts.com/agenda-des-concerts/Clermont-Fd/"
try:
events = u2e.process(url, url_human, cache = "cache-arachnee.html", default_values = {}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-arachnee.html",
default_values={},
published=True,
)
exportfile = "events-arachnee.json"
print("Saving events to file {}".format(exportfile))

View File

@@ -1,40 +1,42 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
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
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
sys.path.append(parent + "/src")
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 *
from src.agenda_culturel.import_tasks.custom_extractors import billetterie_cf
from src.agenda_culturel.import_tasks.downloader import (
ChromiumHeadlessDownloader,
)
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(ChromiumHeadlessDownloader(), billetterie_cf.CExtractor())
url = "https://billetterie-c3c.clermont-ferrand.fr/"
url_human = "https://billetterie-c3c.clermont-ferrand.fr/"
try:
events = u2e.process(url, url_human, cache = "cache-c3c.html", default_values = {"location": "La Cour des 3 Coquins"}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-c3c.html",
default_values={"location": "La Cour des 3 Coquins"},
published=True,
)
exportfile = "events-c3c.json"
print("Saving events to file {}".format(exportfile))

View File

@@ -1,41 +1,38 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
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
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
sys.path.append(parent + "/src")
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.generic_extractors.fbevent import *
from src.agenda_culturel.import_tasks.downloader import (
ChromiumHeadlessDownloader,
)
from src.agenda_culturel.import_tasks.generic_extractors.fbevent import (
CExtractor,
)
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(ChromiumHeadlessDownloader(), CExtractor())
url="https://www.facebook.com/events/3575802569389184/3575802576055850/?active_tab=about"
url = "https://www.facebook.com/events/3575802569389184/3575802576055850/?active_tab=about"
events = u2e.process(url, cache = "fb.html", published = True)
events = u2e.process(url, cache="fb.html", published=True)
exportfile = "event-facebook.json"
print("Saving events to file {}".format(exportfile))
with open(exportfile, "w") as f:
json.dump(events, f, indent=4, default=str)

View File

@@ -1,40 +1,42 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
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
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
sys.path.append(parent + "/src")
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.generic_extractors import *
from src.agenda_culturel.import_tasks.downloader import (
ChromiumHeadlessDownloader,
)
from src.agenda_culturel.import_tasks.generic_extractors import fbevents
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(ChromiumHeadlessDownloader(), fbevents.CExtractor())
url = "https://www.facebook.com/laJeteeClermont/upcoming_hosted_events"
url_human = "https://www.facebook.com/laJeteeClermont/upcoming_hosted_events"
try:
events = u2e.process(url, url_human, cache = "cache-lajetee-fb.html", default_values = {"location": "La Jetée"}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-lajetee-fb.html",
default_values={"location": "La Jetée"},
published=True,
)
exportfile = "events-lajetee-fb.json"
print("Saving events to file {}".format(exportfile))

View File

@@ -1,8 +1,8 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
import sys
# getting the name of the directory
@@ -18,23 +18,25 @@ parent = os.path.dirname(current)
sys.path.append(parent)
sys.path.append(parent + "/src")
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 *
from src.agenda_culturel.import_tasks.custom_extractors import billetterie_cf
from src.agenda_culturel.import_tasks.downloader import (
ChromiumHeadlessDownloader,
)
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(ChromiumHeadlessDownloader(), billetterie_cf.CExtractor())
url = "https://billetterie-gds.clermont-ferrand.fr/"
url_human = "https://billetterie-gds.clermont-ferrand.fr/"
try:
events = u2e.process(url, url_human, cache = "cache-gds.html", default_values = {}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-gds.html",
default_values={},
published=True,
)
exportfile = "events-gds.json"
print("Saving events to file {}".format(exportfile))

View File

@@ -1,39 +1,44 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
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
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
sys.path.append(parent + "/src")
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.generic_extractors.ical import *
from src.agenda_culturel.import_tasks.downloader import SimpleDownloader
from src.agenda_culturel.import_tasks.generic_extractors.ical import (
ICALExtractor,
)
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(SimpleDownloader(), ICALExtractor())
url = "https://calendar.google.com/calendar/ical/programmation.lesaugustes%40gmail.com/public/basic.ics"
url_human = "https://www.cafelesaugustes.fr/la-programmation/"
events = u2e.process(url, url_human, cache = "cache-augustes.ical", default_values = {"category": "Sans catégorie", "location": "Café lecture les Augustes"}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-augustes.ical",
default_values={
"category": "Sans catégorie",
"location": "Café lecture les Augustes",
},
published=True,
)
exportfile = "events-augustes.json"
print("Saving events to file {}".format(exportfile))

View File

@@ -1,40 +1,43 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
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
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
sys.path.append(parent + "/src")
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 *
from src.agenda_culturel.import_tasks.custom_extractors import laraymonde
from src.agenda_culturel.import_tasks.downloader import SimpleDownloader
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(SimpleDownloader(), laraymonde.CExtractor())
url = "https://www.raymondbar.net/"
url_human = "https://www.raymondbar.net/"
try:
events = u2e.process(url, url_human, cache = "cache-la-raymonde.html", default_values = {"location": "La Raymonde", "category": "Fêtes & Concerts"}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-la-raymonde.html",
default_values={
"location": "La Raymonde",
"category": "Fêtes & Concerts",
},
published=True,
)
exportfile = "events-la-raymonde.json"
print("Saving events to file {}".format(exportfile))

View File

@@ -1,40 +1,40 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
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
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
sys.path.append(parent + "/src")
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 *
from src.agenda_culturel.import_tasks.custom_extractors import lacomedie
from src.agenda_culturel.import_tasks.downloader import SimpleDownloader
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(SimpleDownloader(), lacomedie.CExtractor())
url = "https://lacomediedeclermont.com/saison24-25/wp-admin/admin-ajax.php?action=load_dates_existantes"
url_human = "https://lacomediedeclermont.com/saison24-25/"
try:
events = u2e.process(url, url_human, cache = "cache-lacomedie.html", default_values = {"location": "La Comédie de Clermont"}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-lacomedie.html",
default_values={"location": "La Comédie de Clermont"},
published=True,
)
exportfile = "events-lacomedie.json"
print("Saving events to file {}".format(exportfile))

View File

@@ -1,40 +1,43 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
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
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
sys.path.append(parent + "/src")
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 *
from src.agenda_culturel.import_tasks.custom_extractors import lacoope
from src.agenda_culturel.import_tasks.downloader import SimpleDownloader
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(SimpleDownloader(), lacoope.CExtractor())
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.html", default_values = {"category": "Fêtes & Concerts", "location": "La Coopérative"}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-lacoope.html",
default_values={
"category": "Fêtes & Concerts",
"location": "La Coopérative",
},
published=True,
)
exportfile = "events-lacoope.json"
print("Saving events to file {}".format(exportfile))

View File

@@ -1,40 +1,40 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
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
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
sys.path.append(parent + "/src")
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 *
from src.agenda_culturel.import_tasks.custom_extractors import lapucealoreille
from src.agenda_culturel.import_tasks.downloader import SimpleDownloader
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(SimpleDownloader(), lapucealoreille.CExtractor())
url = "https://www.lapucealoreille63.fr/agenda"
url_human = "https://www.lapucealoreille63.fr/agenda"
try:
events = u2e.process(url, url_human, cache = "cache-lapucealoreille.xml", default_values = {}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-lapucealoreille.xml",
default_values={},
published=True,
)
exportfile = "events-lapucealoreille.json"
print("Saving events to file {}".format(exportfile))

View File

@@ -1,40 +1,40 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
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
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
sys.path.append(parent + "/src")
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 *
from src.agenda_culturel.import_tasks.generic_extractors import wordpress_mec
from src.agenda_culturel.import_tasks.downloader import SimpleDownloader
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(SimpleDownloader(), wordpress_mec.CExtractor())
url = "https://www.cabaretlepoulailler.fr/agenda/tout-lagenda/"
url_human = "https://www.cabaretlepoulailler.fr/agenda/tout-lagenda/"
try:
events = u2e.process(url, url_human, cache = "cache-le-poulailler.html", default_values = {"location": "Le Poulailler"}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-le-poulailler.html",
default_values={"location": "Le Poulailler"},
published=True,
)
exportfile = "events-le-poulailler.json"
print("Saving events to file {}".format(exportfile))

View File

@@ -1,40 +1,40 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
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
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
sys.path.append(parent + "/src")
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 *
from src.agenda_culturel.import_tasks.custom_extractors import lerio
from src.agenda_culturel.import_tasks.downloader import SimpleDownloader
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(SimpleDownloader(), lerio.CExtractor())
url = "https://www.cinemalerio.com/evenements/"
url_human = "https://www.cinemalerio.com/evenements/"
try:
events = u2e.process(url, url_human, cache = "cache-le-rio.html", default_values = {"location": "Cinéma le Rio", "category": "Cinéma"}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-le-rio.html",
default_values={"location": "Cinéma le Rio", "category": "Cinéma"},
published=True,
)
exportfile = "events-le-roi.json"
print("Saving events to file {}".format(exportfile))

View File

@@ -1,40 +1,40 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
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
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
sys.path.append(parent + "/src")
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 *
from src.agenda_culturel.import_tasks.custom_extractors import lefotomat
from src.agenda_culturel.import_tasks.downloader import SimpleDownloader
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(SimpleDownloader(), lefotomat.CExtractor())
url = "https://www.lefotomat.com/feed"
url_human = "https://www.lefotomat.com/"
try:
events = u2e.process(url, url_human, cache = "cache-lefotomat.xml", default_values = {"location": "Le Fotomat'"}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-lefotomat.xml",
default_values={"location": "Le Fotomat'"},
published=True,
)
exportfile = "events-lefotomat.json"
print("Saving events to file {}".format(exportfile))

View File

@@ -1,40 +1,40 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
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
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
sys.path.append(parent + "/src")
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.generic_extractors import *
from src.agenda_culturel.import_tasks.downloader import SimpleDownloader
from src.agenda_culturel.import_tasks.generic_extractors import wordpress_mec
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(SimpleDownloader(), wordpress_mec.CExtractor())
url = "https://www.lesvinzelles.com/index.php/programme/"
url_human = "https://www.lesvinzelles.com/index.php/programme/"
try:
events = u2e.process(url, url_human, cache = "cache-les-vinzelles.html", default_values = {"location": "Les Vinzelles"}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-les-vinzelles.html",
default_values={"location": "Les Vinzelles"},
published=True,
)
exportfile = "events-les-vinzelles.json"
print("Saving events to file {}".format(exportfile))

View File

@@ -1,40 +1,40 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
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
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
sys.path.append(parent + "/src")
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.generic_extractors import *
from src.agenda_culturel.import_tasks.downloader import SimpleDownloader
from src.agenda_culturel.import_tasks.extractor import iguana_agenda
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(SimpleDownloader(), iguana_agenda.CExtractor())
url = "https://bibliotheques-clermontmetropole.eu/iguana/Service.PubContainer.cls?uuid=a4a1f992-06da-4ff4-9176-4af0a095c7d1"
url_human = "https://bibliotheques-clermontmetropole.eu/iguana/www.main.cls?surl=AGENDA_Tout%20lagenda"
try:
events = u2e.process(url, url_human, cache = "cache-mediatheques.html", default_values = {}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-mediatheques.html",
default_values={},
published=True,
)
exportfile = "events-mediatheques.json"
print("Saving events to file {}".format(exportfile))

View File

@@ -1,8 +1,8 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
import sys
# getting the name of the directory
@@ -18,23 +18,23 @@ parent = os.path.dirname(current)
sys.path.append(parent)
sys.path.append(parent + "/src")
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 *
from src.agenda_culturel.import_tasks.custom_extractors import mille_formes
from src.agenda_culturel.import_tasks.downloader import SimpleDownloader
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(SimpleDownloader(), mille_formes.CExtractor())
url = "https://www.milleformes.fr/programme"
url_human = "https://www.milleformes.fr/programme"
try:
events = u2e.process(url, url_human, cache = "cache-1000formes.html", default_values = {}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-1000formes.html",
default_values={},
published=True,
)
exportfile = "events-1000formes.json"
print("Saving events to file {}".format(exportfile))

View File

@@ -1,40 +1,40 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
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
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
sys.path.append(parent + "/src")
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.generic_extractors import *
from src.agenda_culturel.import_tasks.downloader import SimpleDownloader
from src.agenda_culturel.import_tasks.generic_extractors import mobilizon
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"
try:
events = u2e.process(url, url_human, cache = "cache-attac63.html", default_values = {}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-attac63.html",
default_values={},
published=True,
)
exportfile = "events-attac63.json"
print("Saving events to file {}".format(exportfile))

View File

@@ -1,40 +1,40 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
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
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
sys.path.append(parent + "/src")
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.generic_extractors import *
from src.agenda_culturel.import_tasks.downloader import SimpleDownloader
from src.agenda_culturel.import_tasks.generic_extractors import apidae_tourisme
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(SimpleDownloader(), apidae_tourisme.CExtractor())
url = "https://widgets.apidae-tourisme.com/filter.js?widget[id]=48"
url_human = "https://ens.puy-de-dome.fr/agenda.html"
try:
events = u2e.process(url, url_human, cache = "cache-puydedome.html", default_values = {}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-puydedome.html",
default_values={},
published=True,
)
exportfile = "events-puydedome.json"
print("Saving events to file {}".format(exportfile))

View File

@@ -3,7 +3,7 @@
## 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:
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.
@@ -12,7 +12,7 @@ La donnée retournée est du html assez succinct, avec l'essentiel dedans.
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"
- meta name="description"
- une url https://calendar.google.com/calendar/ avec la plupart des données
## Le caveau de la michodière
@@ -20,10 +20,9 @@ Sur chaque page événémenet, il y a :
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
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é.