Skip to content

Instantly share code, notes, and snippets.

@tech-nova
Last active September 12, 2015 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tech-nova/cceeccfc708b4f52ffce to your computer and use it in GitHub Desktop.
Save tech-nova/cceeccfc708b4f52ffce to your computer and use it in GitHub Desktop.
Comment récupérer les derniers posts sur tumblr, avec la syndication, la boucle DATA et YQL. C'est moins rapide qu'en utilisant l'API (https://gist.github.com/tech-nova/08a54e50809b60b9a84a)
<BOUCLE_content(SITES){id_syndic=1}>
[(#REM) Articles issus de la syndication ]
<B_articles>
<div class="masonry-container">
<BOUCLE_articles(SYNDIC_ARTICLES) {id_syndic} {!par date} {0,6}>
<div class='masonry mod modBlogPost'>
#SET{url, #LISTE{"select * from html where url=",#URL_ARTICLE," and xpath='//meta[@property=\'og:image\']'"}|implode{'"'}}
#SET{lien,#URL_ARTICLE}
<div class='images'>
<B_og>
<BOUCLE_og(DATA){source yql, #GET{url}}{datapath /query/results}>
[<a href="#GET{lien}">
<img src="(#VALEUR{content}
|sinon{#VALEUR{0/content}}
|image_passe_partout{343,257}
|image_recadre{343,257,center}
|extraire_attribut{src})"/></a>]
</BOUCLE_og>
</B_og>
<a href="#GET{lien}"><img src="[(#CHEMIN{images/pattern-random-gray.png}
|image_passe_partout{343,257}
|image_recadre{343,257,center}
|extraire_attribut{src})]"></a>
<//B_og>
</div>
<div class='content'>
<p class='date'>[(#DATE|affdate_jourcourt)]</p>
<h4><a href="#URL_ARTICLE">#TITRE</a></h4>
[<div class="introduction">(#DESCRIPTIF|image_reduire{353,*})</div>]
</div>
</div>
</BOUCLE_articles>
</div>
</B_articles>
<div class="text-center">
<a href="#URL_SITE" class="button">Lire les anciens messages</a>
</div>
<div class="two spacing"></div>
</BOUCLE_content>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment