Commit Graph
13 Commits
Author SHA1 Message Date
mathieu 38c181203e Modification des entrées du site. Il est passé sur wordpress. Problème pour l'agenda, c'est que ics -> tranformé en rss 2026-10-16 15:33:18 +02:00
paraandClaude Sonnet 5 476c1bf413 Fix W3C validator errors in the Facebook feed proxy
FetchRSS's raw feed fails validation: entry <id> is a bare Facebook post
ID rather than a full URI, and <link rel="self"> points at the FetchRSS
URL instead of where we actually serve it. Parse the fetched XML with
DOMDocument and fix both before caching/serving: reuse each entry's own
alternate link (already a full post URL) as its id, and rewrite the self
link to our own facebook.php URL.

Requires the php-xml extension (ext-dom) — near-universal on shared
hosting, but worth checking if this breaks on deploy.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-26 00:23:02 +02:00
paraandClaude Sonnet 5 dac36592eb Fetch full event detail: batch listing omits text_fr/attachments for events
Found by testing: unlike news items, the agenda @results batch listing
always returns text_fr and items (attachments) as null for events - only
description_fr (short teaser) was ever available from it. The site itself
works around this by firing a second request per event
(@results?UID=<uid>&fullobjects=1) when you open one; we now do the same,
with a per-UID cache since a recurring event shares one UID across all its
occurrences.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-26 00:05:52 +02:00
paraandClaude Sonnet 5 d917e76819 Include lead image in feed item descriptions
The API already returns image_affiche_scale/image_full_scale for every
item (news and events alike), no extra request needed — just wasn't
being used. Embedded as an <img> at the top of the HTML description so
feed readers display it inline with the article.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 23:53:19 +02:00
paraandClaude Sonnet 5 13e5c94ee7 Fix W3C validator errors: duplicate guids and missing atom:link self
- Recurring events share one UID across all occurrences (confirmed via
  the API: same UID, different start dates), which produced duplicate
  <guid> values the RSS spec forbids. Suffix the guid with the
  occurrence's start date to make it unique per occurrence.
- Add atom:link rel="self" to the channel, per the validator's
  recommendation, in both the PHP and Python implementations.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 23:49:31 +02:00
paraandClaude Sonnet 5 13ea82e347 Apply same link/content fixes to the Python variant
Mirrors the fixes made to the PHP feeds: correct link format
(/actualites|agenda/<slug>?u=<UID> instead of the wrong ?news=/?event=),
and full rich-text body + attachment links instead of the short teaser
only. Keeps both implementations in sync even though only the PHP one
is currently deployed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 23:47:19 +02:00
paraandClaude Sonnet 5 7da5a7a3e6 Fix article links and include full content in PHP feeds
Two bugs found by testing real links from the feed:
- Link format was wrong (?news=<internal-id>), landing on the general
  listing instead of the article. Traced the real network call the site
  makes when opening an item and found the actual pattern:
  /actualites/<slug>?u=<UID> (agenda: /agenda/<slug>?u=<UID>), where the
  JS router reads the `u` query param to fetch @results?UID=...&fullobjects=1.
- Description only used the short teaser (description_fr) even though the
  API response already includes the full rich-text body (text_fr.data) and
  attachments (items[].file.download) in the same call — no extra request
  needed, just wasn't being used.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 23:45:55 +02:00
paraandClaude Sonnet 5 113616995f Serve feeds as text/xml instead of application/rss+xml
Browsers (Firefox in particular) force-download application/rss+xml and
application/atom+xml instead of rendering them, which is confusing for
site visitors who click a feed link directly rather than pasting it into
a reader. text/xml renders inline as an XML tree in every major browser.
Feed readers (FreshRSS included) sniff the actual XML content to detect
RSS/Atom, so this has no effect on subscription behavior.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 23:34:30 +02:00
paraandClaude Sonnet 5 a46e9c64a2 Harden PHP feeds: block direct cache access, cap curl redirects
Security review found no exploitable issue — none of the 3 endpoints
accept user input, so there's no injection surface (upstream URLs are
hardcoded constants, output is XML-escaped). These are defense-in-depth
only: deny direct HTTP access to cache/, and cap CURLOPT_MAXREDIRS to
avoid a hung request on a misbehaving upstream.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 22:19:36 +02:00
paraandClaude Sonnet 5 896454aeea Pin PHP deployment instructions to the actual target domain
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 22:10:26 +02:00
paraandClaude Sonnet 5 a48775557e Set actual domain (akbar.nohost.me) in deploy configs
/rss is already taken by FreshRSS on this domain, so the Python+cron
variant serves under /silly-rss/ instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 22:05:31 +02:00
paraandClaude Sonnet 5 8205bfdffc Add PHP variant: no-cron, request-time feed generation for shared hosting
Same imio.smartweb JSON API as the Python script, but each feed regenerates
on demand (15 min file cache) instead of via cron, so it works on plain
PHP shared hosting with no server config access. Also adds facebook.php,
a caching proxy for the user's FetchRSS Atom feed so all three feeds live
under one domain and can be shared as stable URLs.

Tested with PHP 8.3 CLI: valid XML, real data (40 news, 12 events, proxied
Facebook feed).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 22:05:26 +02:00
paraandClaude Sonnet 5 ecf9baaa4d Add RSS feed generator for commune de Silly (actualites + agenda)
Scrapes the imio.smartweb JSON API used by www.silly.be (found via the
smartweb-news/smartweb-events web components in the raw HTML) instead of
needing a headless browser. Shells out to curl since Cloudflare silently
blocks Python's urllib/requests TLS fingerprint. Includes Yunohost cron
and nginx deployment snippets.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 21:36:39 +02:00