<?php
require_once __DIR__ . '/_lib.php';
header('Content-Type: application/rss+xml; charset=utf-8');
$articles = db()->query("SELECT * FROM articles ORDER BY published_at DESC LIMIT 50")->fetchAll(PDO::FETCH_ASSOC);
?><?='<?xml version="1.0" encoding="UTF-8"?>'?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Médecine.AI</title>
<link>https://medecine.ai/</link>
<atom:link href="https://medecine.ai/rss.xml" rel="self" type="application/rss+xml"/>
<description>L'actualité de l'intelligence artificielle en médecine, décryptée sans jargon.</description>
<language>fr</language>
<?php foreach ($articles as $a): ?>
<item>
<title><?= htmlspecialchars($a['title']) ?></title>
<link>https://medecine.ai/article.php?slug=<?= htmlspecialchars($a['slug']) ?></link>
<guid>https://medecine.ai/article.php?slug=<?= htmlspecialchars($a['slug']) ?></guid>
<pubDate><?= date(DATE_RSS, strtotime($a['published_at'])) ?></pubDate>
<category><?= htmlspecialchars(cat_label($a['category'])) ?></category>
<description><?= htmlspecialchars($a['excerpt']) ?></description>
</item>
<?php endforeach; ?>
</channel>
</rss>