Skip to content

Instantly share code, notes, and snippets.

@brunob brunob/cleanrss.html
Last active Feb 8, 2017

Embed
What would you like to do?
Un squelette SPIP qui prend l'url d'un flux RSS non valide en paramètre pour renvoyer le flux au propre. Pratique pour syndiquer certains flux WordPress (odgprod par exemple) dans Nextcoud. https://seenthis.net/messages/568088
#CACHE{0}
[(#HTTP_HEADER{Content-type: text/xml[; charset=(#CHARSET)]})]<?xml
version="1.0"[ encoding="(#CHARSET)"]?>
<rss version="2.0" [(#REM) rss 2.0.9)]
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
>
[(#SET{channel,#ENV{url}|analyser_site})]
<channel[ xml:lang="(#LANG)"]>
[<title>(#GET{channel}|table_valeur{nom_site}|textebrut|texte_backend)</title>]
[<link>(#GET{channel}|table_valeur{url_site})</link>]
[<description>(#GET{channel}|table_valeur{descriptif}|supprimer_tags|texte_backend)</description>]
[<image>
<url>(#GET{channel}|table_valeur{logo})</url>
</image>]
<BOUCLE_items(DATA){source rss, #ENV{url}}>
<item>
[<title>(#TITRE|supprimer_tags|texte_backend)</title>]
[<link>(#URL)</link>]
[<description>(#DESCRIPTIF|texte_backend)</description>]
[<dc:date>(#DATE|date_iso)</dc:date>]
[<guid>(#URL)</guid>]
</item>
</BOUCLE_items>
</channel>
</rss>
<?php
if (!defined("_ECRIRE_INC_VERSION")) {
return;
}
include_spip('inc/site');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.