Last active
February 8, 2017 18:07
-
-
Save brunob/8533824a4ea3c57f928554e99b0991dd to your computer and use it in GitHub Desktop.
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
This file contains hidden or 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
#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> |
This file contains hidden or 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
<?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