-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
32abff6
commit 9c87237
Showing
8 changed files
with
117 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { JSDOM } from 'jsdom'; | ||
import epci from '@etalab/decoupage-administratif/data/epci.json' assert { type: 'json' }; | ||
import { slugify } from '../src/lib/utils.js'; | ||
import { writeJsonData } from '../src/scripts/writeData.js'; | ||
|
||
const source = await fetch('https://www.villes.plus/cyclables/metropoles'); | ||
const { document } = new JSDOM(await source.text()).window; | ||
|
||
const rawMetropoles = [...document.querySelectorAll('h3')].map((h3) => h3.textContent); | ||
|
||
const simplify = (s) => | ||
slugify(s) | ||
.replace(/[0-9]/g, '') | ||
.replace(/((euro)?metropole|de|)/g, '') | ||
.replace(/(^-+|-+$)/g, ''); | ||
|
||
const normalizedEpciNames = rawMetropoles.map( | ||
(line) => epci.find(({ nom }) => simplify(nom).includes(simplify(line)))?.nom | ||
); | ||
|
||
if (normalizedEpciNames.find((n) => !n)) { | ||
console.log('❌ Missing EPCI:'); | ||
console.log(normalizedEpciNames.filter(Boolean).join('\n')); | ||
} else { | ||
console.log("✅ All EPCI's found:"); | ||
console.log(normalizedEpciNames.join('\n')); | ||
writeJsonData('classement-villeplus.json', normalizedEpciNames); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,49 @@ | ||
{ | ||
"name": "mesaidesvelo", | ||
"version": "1.0.0", | ||
"scripts": { | ||
"postinstall": "node ./src/scripts/postinstall.js", | ||
"dev": "VITE_SITE=mesaidesvelo.fr vite dev", | ||
"dev:retrofit": "VITE_SITE=aideretrofit.fr vite dev", | ||
"build": "VITE_SITE=mesaidesvelo.fr vite build", | ||
"build:retrofit": "VITE_SITE=aideretrofit.fr vite build", | ||
"preview": "VITE_SITE=mesaidesvelo.fr vite preview", | ||
"sync-entreprises": "node ./data-fetch/entreprises/download-gsheet-data.js", | ||
"sync": "svelte-kit sync", | ||
"test": "npm run test:playwright && npm run test:vitest -- run", | ||
"test:playwright": "npx playwright test tests/navigation.spec.js", | ||
"test:vitest": "vitest", | ||
"lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. .", | ||
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ." | ||
}, | ||
"type": "module", | ||
"private": true, | ||
"devDependencies": { | ||
"@actions/core": "^1.10.0", | ||
"@actions/github": "^5.1.1", | ||
"@playwright/test": "^1.35.1", | ||
"@rollup/plugin-yaml": "^4.1.1", | ||
"@sveltejs/adapter-vercel": "^3.0.1", | ||
"@sveltejs/kit": "^1.21.0", | ||
"mdsvex": "^0.11.0", | ||
"node-fetch": "^3.3.1", | ||
"prettier": "^2.8.8", | ||
"prettier-plugin-svelte": "^2.10.1", | ||
"sharp": "=0.32.1", | ||
"svelte": "^4.0.1", | ||
"typescript": "^5.1.6", | ||
"vite": "^4.3.9", | ||
"vite-plugin-windicss": "^1.9.0", | ||
"vitest": "^0.32.2", | ||
"wget-improved": "^3.4.0", | ||
"yaml": "^2.3.1" | ||
}, | ||
"dependencies": { | ||
"@etalab/decoupage-administratif": "^3.0.0", | ||
"fuzzysort": "^2.0.4", | ||
"playwright-aws-lambda": "^0.10.0", | ||
"playwright-core": "^1.35.1", | ||
"publicodes": "^1.0.0-beta.70" | ||
} | ||
"name": "mesaidesvelo", | ||
"version": "1.0.0", | ||
"scripts": { | ||
"postinstall": "node ./src/scripts/postinstall.js", | ||
"dev": "VITE_SITE=mesaidesvelo.fr vite dev", | ||
"dev:retrofit": "VITE_SITE=aideretrofit.fr vite dev", | ||
"build": "VITE_SITE=mesaidesvelo.fr vite build", | ||
"build:retrofit": "VITE_SITE=aideretrofit.fr vite build", | ||
"preview": "VITE_SITE=mesaidesvelo.fr vite preview", | ||
"sync-entreprises": "node ./data-fetch/entreprises/download-gsheet-data.js", | ||
"sync": "svelte-kit sync", | ||
"test": "npm run test:playwright && npm run test:vitest -- run", | ||
"test:playwright": "npx playwright test tests/navigation.spec.js", | ||
"test:vitest": "vitest", | ||
"lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. .", | ||
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ." | ||
}, | ||
"type": "module", | ||
"private": true, | ||
"devDependencies": { | ||
"@actions/core": "^1.10.0", | ||
"@actions/github": "^5.1.1", | ||
"@playwright/test": "^1.35.1", | ||
"@rollup/plugin-yaml": "^4.1.1", | ||
"@sveltejs/adapter-vercel": "^3.0.1", | ||
"@sveltejs/kit": "^1.21.0", | ||
"mdsvex": "^0.11.0", | ||
"node-fetch": "^3.3.1", | ||
"prettier": "^2.8.8", | ||
"prettier-plugin-svelte": "^2.10.1", | ||
"sharp": "=0.32.1", | ||
"svelte": "^4.0.1", | ||
"typescript": "^5.1.6", | ||
"vite": "^4.3.9", | ||
"vite-plugin-windicss": "^1.9.0", | ||
"vitest": "^0.32.2", | ||
"wget-improved": "^3.4.0", | ||
"yaml": "^2.3.1" | ||
}, | ||
"dependencies": { | ||
"@etalab/decoupage-administratif": "^3.0.0", | ||
"fuzzysort": "^2.0.4", | ||
"jsdom": "^22.1.0", | ||
"playwright-aws-lambda": "^0.10.0", | ||
"playwright-core": "^1.35.1", | ||
"publicodes": "^1.0.0-beta.70" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[ | ||
"Eurométropole de Strasbourg", | ||
"Bordeaux Métropole", | ||
"Grenoble-Alpes-Métropole", | ||
"Toulouse Métropole", | ||
"Montpellier Méditerranée Métropole", | ||
"Métropole Toulon-Provence-Méditerranée", | ||
"Orléans Métropole", | ||
"CC du Bassin de Marennes", | ||
"Métropole du Grand Paris", | ||
"CC de la Plaine Dijonnaise", | ||
"Métropole de Lyon", | ||
"Tours Métropole Val de Loire", | ||
"Nantes Métropole", | ||
"Brest Métropole", | ||
"Métropole du Grand Nancy", | ||
"Métropole Européenne de Lille", | ||
"Clermont Auvergne Métropole", | ||
"Metz Métropole", | ||
"Métropole Rouen Normandie", | ||
"Métropole Nice Côte d'Azur", | ||
"Métropole d'Aix-Marseille-Provence", | ||
"Saint-Etienne Métropole" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters