进程Tumblr JSON提要
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了进程Tumblr JSON提要相关的知识,希望对你有一定的参考价值。
Tumblr API: http://www.tumblr.com/docs/de/api
<?php $posts = $jsondata['posts']; $blogroll = ""; foreach($posts as $post){ $blogroll .= "<p>"; $blogroll .= $date."<br />"; switch ($post['type']) { case 'photo': $blogroll .= "<a href='".$post['url-with-slug']."' target='_blank'>".str_replace('-',' ',$post['slug'])."</a>"; break; case 'link': $blogroll .= "<a href='".$post['url-with-slug']."' target='_blank'>".$post['link-text']."</a><br />"; break; case 'regular': $blogroll .= "<a href='".$post['url-with-slug']."' target='_blank'>".$post['regular-title']."</a><br />"; break; case 'quote': $blogroll .= "<a href='".$post['url-with-slug']."' target='_blank'>".str_replace('-',' ',$post['slug'])."</a><br />"; break; case 'conversation': $blogroll .= "<a href='".$post['url-with-slug']."' target='_blank'>".str_replace('-',' ',$post['slug'])."</a><br />"; }else{ $blogroll .= "<a href='".$post['url-with-slug']."' target='_blank'>".$post['conversation-title']."</a><br />"; } break; case 'audio': $blogroll .= "<a href='".$post['url-with-slug']."' target='_blank'>".str_replace('-',' ',$post['slug'])."</a><br />"; }else{ $blogroll .= "<a href='".$post['url-with-slug']."' target='_blank'>".strip_tags($post['audio-caption'])."</a><br />"; } break; default: $blogroll .= "<a href='".$post['url-with-slug']."' target='_blank'>".str_replace('-',' ',$post['slug'])."</a>"; break; } $blogroll .= "</p>"; } echo $blogroll; ?>
以上是关于进程Tumblr JSON提要的主要内容,如果未能解决你的问题,请参考以下文章