diff --git a/cities_data.json b/cities_data.json deleted file mode 100644 index f7f05ea..0000000 --- a/cities_data.json +++ /dev/null @@ -1 +0,0 @@ -[{"name":"Annezin","lat":"50.5415","lon":"2.6193","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/a\/annezin\/01-Comite-des-Bons-Voisins-99-Fete-Nationale-puces.php"},{"name":"Auchy les Hesdin","lat":"50.3988228","lon":"2.1019554","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/a\/auchy-les-hesdin\/01-Comite-Animation-99-Fete-Nationale-brocante.php"},{"name":"Bavay","lat":"50.2978864","lon":"3.7949291","href":"http:\/\/www.sabradou.com\/59-nord\/b\/bavay\/01-Eclaireurs-de-Bavay-99-Fete-Nationale-vide-greniers.php"},{"name":"Bois Bernard","lat":"50.3815339","lon":"2.911883","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/b\/bois-bernard\/00-Mairie-99-Fete-Nationale-vide-greniers.php"},{"name":"Bourbourg","lat":"50.9466619","lon":"2.1973702","href":"http:\/\/www.sabradou.com\/59-nord\/b\/bourbourg\/01-Les-Zamuztaers-99-Fete-Nationale-braderie.php"},{"name":"Busigny","lat":"50.0350792","lon":"3.4692426","href":"http:\/\/www.sabradou.com\/59-nord\/b\/busigny\/01-La-Croquantique-Cars-99-Fete-Nationale-auto.php"},{"name":"Calais","lat":"50.9524769","lon":"1.8538446","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/c\/calais\/01-Commercants-99-Fete-Nationale-brocante.php"},{"name":"Camblain Chatelain","lat":"50.4822875","lon":"2.4637444","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/c\/camblain-chatelain\/01-Foot-loisir-les-petits-camblinois-99-Fete-Nationale-puces.php"},{"name":"Chereng","lat":"50.6111045","lon":"3.2022404","href":"http:\/\/www.sabradou.com\/59-nord\/c\/chereng\/00-Mairie-99-Fete-Nationale-brocante.php"},{"name":"Colleret","lat":"50.2563884","lon":"4.075551","href":"http:\/\/www.sabradou.com\/59-nord\/c\/colleret\/01-GeneaColleret-14-Juillet-brocante.php"},{"name":"Comines","lat":"50.7653265","lon":"3.0066319","href":"http:\/\/www.sabradou.com\/59-nord\/c\/comines\/01-La-Louche-Cominoise-99-Fete-Nationale-puces.php"},{"name":"Coulogne","lat":"50.9257432","lon":"1.8840904","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/c\/coulogne\/01-La-Vitesse-99-Fete-Nationale-brocante.php"},{"name":"Cysoing","lat":"50.5677767","lon":"3.215489","href":"http:\/\/www.sabradou.com\/59-nord\/c\/cysoing\/01-EACCWB-99-Fete-Nationale-brocante.php"},{"name":"Ecquedecques","lat":"50.5621192","lon":"2.4487029","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/e\/ecquedecques\/00-Comite-des-Fetes-99-Fete-Nationale-puces.php"},{"name":"Estaires","lat":"50.6440257","lon":"2.7226506","href":"http:\/\/www.sabradou.com\/59-nord\/e\/estaires\/00-Mairie-99-Fete-Nationale-brocante.php"},{"name":"Ferques","lat":"50.8310488","lon":"1.7677496","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/f\/ferques\/01-Comite-des-Fetes-99-Fete-Nationale-brocante.php"},{"name":"Feuchy","lat":"50.2944503","lon":"2.8449543","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/f\/feuchy\/00-Mairie-99-Fete-Nationale-brocante.php"},{"name":"Fressain","lat":"50.2851168","lon":"3.1921922","href":"http:\/\/www.sabradou.com\/59-nord\/f\/fressain\/00-Mairie-07-Juillet-brocante.php"},{"name":"Grand Fort Philippe","lat":"51.0014456","lon":"2.1045965","href":"http:\/\/www.sabradou.com\/59-nord\/g\/grand-fort-philippe\/01-Tous-en-Fete-07-Juillet-brocante.php"},{"name":"Houlle","lat":"50.7965913","lon":"2.1742979","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/h\/houlle\/00-Mairie-99-Fete-Nationale-brocante.php"},{"name":"La Herli\u00e8re","lat":"50.2077561","lon":"2.5593211","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/l\/La-Herliere\/00-Comite-des-Fetes-99-Fete-Nationale-brocante.php"},{"name":"Labourse","lat":"50.4972978","lon":"2.679865","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/l\/labourse\/00-Comite-des-Fetes-07-Juillet-puces.php"},{"name":"Laires","lat":"50.539137","lon":"2.2553139","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/l\/laires\/01-lAir-en-Fete-07-Jullet-brocante.php"},{"name":"Lapugnoy","lat":"50.5204","lon":"2.5342","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/l\/lapugnoy\/01-ASC-Lapugnoy-99-Fete-Nationale-puces.php"},{"name":"Lecluse","lat":"50.2765792","lon":"3.0388851","href":"http:\/\/www.sabradou.com\/59-nord\/l\/lecluse\/00-Comite-Festif-Cummunal-Leclusien-99-Fete-Nationale-brocante.php"},{"name":"Lens","lat":"50.4291723","lon":"2.8319805","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/l\/lens\/01-Medailles-du-Travail-4-07-Juillet-puces.php"},{"name":"Lewarde","lat":"50.340485","lon":"3.1677313","href":"http:\/\/www.sabradou.com\/59-nord\/l\/lewarde\/01-Societe-de-Chasse-99-Fete-Nationale-vide-greniers.php"},{"name":"Loos","lat":"50.6092082","lon":"3.0162523","href":"http:\/\/www.sabradou.com\/59-nord\/l\/loos\/01-La-Fabrique-Emploi-99-Fete-Nationale-brocante.php"},{"name":"Malo les Bains","lat":"51.0466792","lon":"2.3984694","href":"http:\/\/www.sabradou.com\/59-nord\/m\/malo-les-bains\/01-UCAM-99-Fete-Nationale-brocante.php"},{"name":"Marcq en Baroeul","lat":"50.6767018","lon":"3.1043032","href":"http:\/\/www.sabradou.com\/59-nord\/m\/marcq-en-baroeul\/01-Enseignes-De-Marcq-99-Fete-Nationale-vide-greniers.php"},{"name":"Maubeuge","lat":"50.2796417","lon":"3.9674127","href":"http:\/\/www.sabradou.com\/59-nord\/m\/maubeuge\/00-Comite-des-Fetes-Epinette-99-Fete-Nationale-brocante.php"},{"name":"Mencas","lat":"50.5598051","lon":"2.1384847","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/m\/mencas\/00-Comite-des-Fetes-99-Fete-Nationale-brocante.php"},{"name":"Montreuil","lat":"50.4638918","lon":"1.7631125","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/m\/montreuil\/01-Union-Commerciale-Montreuilloise-99-Fete-Nationale-brocante.php"},{"name":"Mortagne du Nord","lat":"50.5036803","lon":"3.4552401","href":"http:\/\/www.sabradou.com\/59-nord\/m\/mortagne-du-nord\/00-Mairie-99-Fete-Nationale-brocante.php"},{"name":"Mouvaux","lat":"50.7029","lon":"3.13689","href":"http:\/\/www.sabradou.com\/59-nord\/m\/mouvaux\/01-Bourloire-Saint-Germain-99-Fete-Nationale-brocante.php"},{"name":"Noeux Les Mines","lat":"50.4808898","lon":"2.6620888","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/n\/noeux-les-mines\/00-Mairie-99-Fete-Nationale-puces.php"},{"name":"Noyelles sous Lens","lat":"50.4307524","lon":"2.8760012","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/n\/noyelles-sous-lens\/01-Canari-Club-07-Juillet-vide-greniers.php"},{"name":"Phalempin","lat":"50.5172168","lon":"3.0180377","href":"http:\/\/www.sabradou.com\/59-nord\/p\/phalempin\/01-Phalempin-CGeant-07-Juillet-braderie.php"},{"name":"Provin","lat":"50.5151406","lon":"2.9133145","href":"http:\/\/www.sabradou.com\/59-nord\/p\/provin\/01-Office-Culturel-Provinois-99-Fete-Nationale-braderie.php"},{"name":"Quarouble","lat":"50.3863821","lon":"3.6244948","href":"http:\/\/www.sabradou.com\/59-nord\/q\/quarouble\/00-Comite-des-Fetes-99-Fete-Nationale-brocante.php"},{"name":"Raches","lat":"50.4149446","lon":"3.136211","href":"http:\/\/www.sabradou.com\/59-nord\/r\/raches\/01-Feel-Dance-and-co-99-Fete-Nationale-vide-greniers.php"},{"name":"Rinxent","lat":"50.8064","lon":"1.73997","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/r\/rinxent\/01-Tous-ensemble-pour-Rinxent-99-Fete-Nationale-brocante.php"},{"name":"Rumilly en Cambresis","lat":"50.1287091","lon":"3.2188323","href":"http:\/\/www.sabradou.com\/59-nord\/r\/rumilly-en-cambresis\/01-Societe-de-chasse-07-Juillet-brocante.php"},{"name":"St Marie Kerque","lat":"50.9005923","lon":"2.1374585","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/s\/sainte-marie-kerque\/01-US-Football-99-Fete-Nationale-vide-greniers.php"},{"name":"Thun Saint Martin","lat":"50.2213563","lon":"3.3053776","href":"http:\/\/www.sabradou.com\/59-nord\/t\/thun-saint-martin\/00-Mairie-99-Fete-Nationale-brocante.php"},{"name":"Vendin le Vieil","lat":"50.4756482","lon":"2.8671553","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/v\/vendin-le-vieil\/01-Societes-locales-99-Fete-Nationale-puces.php"},{"name":"Achiet le Grand","lat":"50.1320114","lon":"2.7843609","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/a\/achiet-le-grand\/00-Mairie-07-Juillet-brocante.php"},{"name":"Annequin","lat":"50.5091797","lon":"2.72736","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/a\/annequin\/01-les-chasseurs-Annequin-07-Juillet-puces.php"},{"name":"Bailleul","lat":"50.7396668","lon":"2.7349286","href":"http:\/\/www.sabradou.com\/59-nord\/b\/bailleul\/00-Comite-des-Fetes-07-Juillet-brocante.php"},{"name":"Bienvillers au Bois","lat":"50.1748294","lon":"2.6202668","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/b\/bienvillers-au-bois\/00-Mairie-07-Juillet-brocante.php"},{"name":"Billy Berclau","lat":"50.5189176","lon":"2.8674884","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/b\/billy-berclau\/01-14S-Diner-07-Juillet-puces.php"},{"name":"Calonne Ricouart","lat":"50.4869689","lon":"2.481762","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/c\/calonne-ricouart\/01-Quartier-Cite-6-07-Juillet-puces.php"},{"name":"Cambrin","lat":"50.5114029","lon":"2.7403226","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/c\/cambrin\/00-Comite-des-Fetes-07-Juillet-puces.php"},{"name":"Dentergem","lat":"50.96616075","lon":"3.401986033802248","href":"http:\/\/www.sabradou.com\/00-belgique\/d\/Dentergem\/01-hobby13-07-Juillet-brocante.php"},{"name":"Douai","lat":"50.3675677","lon":"3.0804641","href":"http:\/\/www.sabradou.com\/59-nord\/d\/douai\/00-le-bouquiniste-livre.php"},{"name":"Ebblinghem","lat":"50.7333102","lon":"2.4094016","href":"http:\/\/www.sabradou.com\/59-nord\/e\/ebblinghem\/00-Comite-des-Fetes-07-Juillet-brocante.php"},{"name":"Estrees","lat":"49.9666304","lon":"3.2873583","href":"http:\/\/www.sabradou.com\/59-nord\/e\/estrees\/01-Association-07-Juillet-vide-greniers.php"},{"name":"Ferriere La Grande","lat":"50.2560051","lon":"3.9942662","href":"http:\/\/www.sabradou.com\/59-nord\/f\/ferriere-la-grande\/00-Arche-du-Val-de-Sambre.php"},{"name":"Grenay","lat":"50.4482588","lon":"2.7396733","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/g\/grenay\/01-Societe-de-Chasse-07-Juillet-puces.php"},{"name":"Lomme","lat":"50.6457022","lon":"2.9870927","href":"http:\/\/www.sabradou.com\/59-nord\/l\/lomme\/01-Collectif-Sentiers-Culturels-07-Juillet-modelisme-voiture.php"},{"name":"Merlimont","lat":"50.4553061","lon":"1.614809","href":"http:\/\/www.sabradou.com\/62-pas-de-calais\/m\/merlimont\/01-Randopale-07-Juillet-brocante.php"},{"name":"Rexpoede","lat":"50.939354","lon":"2.5388577","href":"http:\/\/www.sabradou.com\/59-nord\/r\/rexpoede\/00-Comite-des-Fetes-07-Juillet-brocante.php"}] \ No newline at end of file diff --git a/core.php b/core.php index 813ec22..7ff092b 100644 --- a/core.php +++ b/core.php @@ -136,3 +136,26 @@ function geocode($cities) return $citiesData; } + +function getDatejour($jour) { + + // URL de la page à analyser + $url = 'https://www.sabradou.com/' . $jour; + + // Récupération du contenu de la page + $html = file_get_contents($url); + + // Création d'un objet DOMDocument + $dom = new DOMDocument(); + libxml_use_internal_errors(true); // Ignore les erreurs de parsing HTML + $dom->loadHTML($html); + libxml_clear_errors(); + + // Recherche du

avec l'id "datejour" + $datejourH2 = $dom->getElementById('datejour'); + + // Extraire la date du contenu du

+ $datejour = trim($datejourH2->nodeValue); + + return $datejour; +} diff --git a/index.php b/index.php index 95323fa..791ad69 100644 --- a/index.php +++ b/index.php @@ -17,12 +17,13 @@

SUR LE SITE SABRADOU.COM

- - - - + + +
@@ -30,40 +31,41 @@
-
- - + + // Placer des marqueurs pour chaque ville sur la carte + cities.forEach(function (city) { + var marker = L.marker([city.lat, city.lon]).addTo(map); + marker.bindPopup('' + city.name + ''); + }); +