Repository Public
1# =============================================================================2# SP BOUCHER | SOFTWARE & RESEARCH3# ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING4# =============================================================================5#6# PROJECT METADATA7# -----------------------------------------------------------------------------8# Project : Fabri·Ka9# File : scripts/sitemap_inventory.py10# Module : scripts11# Repository : https://git.spboucher.ai/fabri-ka12# Created : 2026-08-1213# Last Modified : 2026-08-1214#15# =============================================================================16# AUTHOR & PROFESSIONAL AFFILIATION17# =============================================================================18#19# Author : Simon-Pierre Boucher20# Position : Professor of Finance21# Institution : Université du Québec en Outaouais (UQO)22# Department : Département des sciences administratives23# Organization : SP Boucher24#25# Website : https://spboucher.ai26# Git : https://git.spboucher.ai27#28# =============================================================================29# OFFICIAL CONTACT DIRECTORY30# =============================================================================31#32# General : info@spboucher.ai33# Professional : contact@spboucher.ai34# Direct : simon@spboucher.ai35# Research : research@spboucher.ai36# Development : dev@spboucher.ai37# Support : support@spboucher.ai38# Security/Admin : admin@spboucher.ai39# Notifications : notifications@spboucher.ai40#41# Preferred Contact: contact@spboucher.ai42#43# =============================================================================44# COPYRIGHT & INTELLECTUAL PROPERTY45# =============================================================================46#47# Copyright (c) 202648# Simon-Pierre Boucher49#50# All rights reserved where applicable.51#52# This file is governed by the applicable project license,53# copyright notices, institutional agreements and relevant law.54#55# Unless expressly authorized by the applicable license or56# rights holder, copying, redistribution, sublicensing,57# publication and commercial exploitation are not permitted.58#59# Existing third-party rights and notices remain unaffected.60#61# =============================================================================62# CONFIDENTIALITY & SECURITY63# =============================================================================64#65# Classification : Public66# Distribution : Public repository; use is governed by the project license67# Security Contact : admin@spboucher.ai68#69# Access to this source does not independently grant permission70# to redistribute or disclose confidential materials.71#72# Do not embed credentials, private keys, access tokens,73# certificates or confidential personal information.74#75# =============================================================================76# LICENSE & MAINTENANCE77# =============================================================================78#79# License : None specified (no license file in this repository)80# Maintainer : Simon-Pierre Boucher81# Technical Contact: dev@spboucher.ai82#83# =============================================================================84# END OF SP BOUCHER SOURCE HEADER85# =============================================================================8687import requests, re, collections88from urllib.parse import urlparse89HDRS={"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126 Safari/537.36"}90def fetch(u):91 try: return requests.get(u,headers=HDRS,timeout=20).text92 except Exception as e: return ""93def urls_from(xml):94 return re.findall(r"<loc>\s*(.*?)\s*</loc>", xml)95def expand(root, depth=0):96 xml = fetch(root)97 locs = urls_from(xml)98 out=[]99 if "<sitemapindex" in xml and depth<2:100 for l in locs: out += expand(l, depth+1)101 else:102 out = locs103 return out104SITEMAPS = {105 "alimentsduquebec": "https://alimentsduquebec.com/sitemaps-1-sitemap.xml",106 "lesproduitsduquebec": "https://lesproduitsduquebec.com/sitemap.xml",107 "metiersdart": "https://www.metiersdart.ca/sitemap.xml",108 "vinsduquebec": "https://vinsduquebec.com/sitemap.xml",109 "cidreduquebec": "https://cidreduquebec.com/wp-sitemap.xml",110 "ambq": "https://ambq.ca/sitemap.xml",111 "fromagesdici": "https://www.fromagesdici.com/sitemap.xml",112 "erabledici": "https://www.erabledici.ca/sitemap_index.xml",113 "terroiretsaveurs": "https://terroiretsaveurs.com/sitemap_index.xml",114 "marchespublics": "https://www.marchespublicsduquebec.ca/sitemap.xml",115 "artisansaloeuvre": "https://artisansaloeuvre.com/sitemap_index.xml",116}117for name, sm in SITEMAPS.items():118 urls = expand(sm)119 pat = collections.Counter()120 for u in urls:121 p = urlparse(u).path122 segs = [s for s in p.split("/") if s]123 pat["/"+segs[0]+"/*" if segs else "/"] += 1124 print("="*60); print(name, "total:", len(urls))125 for k,v in pat.most_common(12): print(f" {v:6d} {k}")126