Created
September 12, 2015 10:50
-
-
Save tech-nova/08a54e50809b60b9a84a to your computer and use it in GitHub Desktop.
Récupérer facilement les derniers posts de Tumblr avec la boucle DATA de SPIP
This file contains 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
<BOUCLE_getPosts(DATA){source xml, http://#####.tumblr.com/api/read/?num=6} | |
{datapath posts} | |
{2,1} | |
><B_post> | |
<div class="masonry-container"> | |
<BOUCLE_post(DATA){source table,#VALEUR}> | |
<div class='masonry mod modBlogPost'> | |
[(#VALEUR{type}|=={photo}|oui) | |
[<a href="#VALEUR{url-with-slug}"> | |
<img src="(#VALEUR{0/photo-url/0} | |
|image_passe_partout{343,257} | |
|image_recadre{343,257,center} | |
|extraire_attribut{src})"/> | |
</a>] | |
<div class='content'> | |
<p class='date'>[(#VALEUR{date-gmt}|affdate_jourcourt)]</p> | |
[<div class="introduction"><a href="#VALEUR{url-with-slug}">(#VALEUR{0/photo-caption/0})</a></div>] | |
</div> | |
][(#VALEUR{type}|=={video}|oui) | |
#VALEUR*{0/video-player/0} | |
<div class='content'> | |
<p class='date'>[(#VALEUR{date-gmt}|affdate_jourcourt)]</p> | |
[<div class="introduction"><a href="#VALEUR{url-with-slug}">(#VALEUR{0/video-caption/0})</a></div>] | |
</div> | |
][(#VALEUR{type}|=={audio}|oui) | |
#VALEUR*{0/audio-player/0} | |
<div class='content'> | |
<p class='date'>[(#VALEUR{date-gmt}|affdate_jourcourt)]</p> | |
[<div class="introduction"><a href="#VALEUR{url-with-slug}">(#VALEUR{0/audio-caption/0})</a></div>] | |
</div> | |
][(#VALEUR{type}|=={link}|oui) | |
<div class='content'> | |
<p class='date'>[(#VALEUR{date-gmt}|affdate_jourcourt)]</p> | |
<h4><a href="#VALEUR{url-with-slug}">#VALEUR{0/link-text/0}</a></h4> | |
[<div class="introduction">(#VALEUR{0/link-description/0})</div>] | |
</div> | |
][(#VALEUR{type}|=={regular}|oui) | |
<div class='content'> | |
<p class='date'>[(#VALEUR{date-gmt}|affdate_jourcourt)]</p> | |
<h4><a href="#VALEUR{url-with-slug}">#VALEUR{0/regular-title}</a></h4> | |
[<div class="introduction">(#VALEUR{0/regular-body/0})</div>] | |
</div> | |
][(#VALEUR{type}|=={quote}|oui) | |
<div class='content'> | |
<p class='date'>[(#VALEUR{date-gmt}|affdate_jourcourt)]</p> | |
<blockquote>#VALEUR{0/quote-text/0}</blockquote> | |
[<p>(#VALEUR{0/quote-source/0})</p>] | |
</div> | |
][(#VALEUR{type}|=={answer}|oui) | |
<div class='content'> | |
<p class='date'>[(#VALEUR{date-gmt}|affdate_jourcourt)]</p> | |
<dl> | |
<dt><a href="#VALEUR{url-with-slug}">#VALEUR{0/question/0}</a></dt> | |
[<dd>(#VALEUR{0/answer/0})</dd>] | |
</div> | |
] | |
</div> | |
</BOUCLE_post> | |
</div> | |
<B_post> | |
</BOUCLE_getPosts> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment