Skip to content

Instantly share code, notes, and snippets.

@nhoizey
Last active September 5, 2016 22:10
Show Gist options
  • Save nhoizey/871aade6c22ca4bbc96983f063a93cf3 to your computer and use it in GitHub Desktop.
Save nhoizey/871aade6c22ca4bbc96983f063a93cf3 to your computer and use it in GitHub Desktop.
Export de forums SPIP pour import dans Disqus

ATTENTION, les articles sont supposés être des redirections vers les nouvelles URL des contenus dans cette version du squelette. Modifiez le contenu de <link> si ce n'est pas le cas.

Déposer les deux squelettes à la racine et appeler la page /?page=disqus-export

<BOUCLE_commentaires(FORUMS){id_article}{plat}>
<wp:comment>
<wp:comment_id>#ID_FORUM</wp:comment_id>
<wp:comment_author>#AUTEUR*</wp:comment_author>
<wp:comment_author_email>#EMAIL</wp:comment_author_email>
<wp:comment_author_url>#URL_SITE</wp:comment_author_url>
<wp:comment_author_IP></wp:comment_author_IP>
<wp:comment_date_gmt>[(#DATE|affdate{'Y-m-d H:i:s'})]</wp:comment_date_gmt>
<wp:comment_content><![CDATA[[(#TEXTE*|liens_absolus)]]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_parent>#ID_PARENT</wp:comment_parent>
</wp:comment>
</BOUCLE_commentaires>
[(#REM) Squelette basé sur https://help.disqus.com/customer/portal/articles/472150-custom-xml-import-format
]#CACHE{1}
[(#HTTP_HEADER{Content-type: application/atom+xml; type=feed; charset=UTF-8})]<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dsq="http://www.disqus.com/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:wp="http://wordpress.org/export/1.0/"
>
<channel>
<BOUCLE_articles(ARTICLES){par date}{inverse}>
<item>
<title>[(#TITRE*|supprimer_numero|supprimer_tags)]</title>
<link>#VIRTUEL</link>]
<content:encoded></content:encoded>
<dsq:thread_identifier>#VIRTUEL</dsq:thread_identifier>
<wp:post_date_gmt>[(#DATE|affdate{'Y-m-d H:i:s'})]</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
#INCLURE{fond=disqus-export-forum,id_article}
</item>
</BOUCLE_articles>
</channel>
</rss>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment