Php tumblr API获取post';s的评论 Tumblr中的注释称为注释
有关详细信息,请参见-/posts-部分 对于您的特定问题,您只需在API请求时将布尔值Php tumblr API获取post';s的评论 Tumblr中的注释称为注释,php,api,tumblr,Php,Api,Tumblr,有关详细信息,请参见-/posts-部分 对于您的特定问题,您只需在API请求时将布尔值notes\u info设置为true即可。例如: 通用API post请求 API要求张贴说明 所以只要更改您的提要URL,您就可以开始了。Tumblr中的注释称为注释 有关详细信息,请参见-/posts-部分 对于您的特定问题,您只需在API请求时将布尔值notes\u info设置为true即可。例如: 通用API post请求 API要求张贴说明 因此,只要更改您的提要URL,您就可以开始了。
notes\u info
设置为true即可。例如:
通用API post请求
API要求张贴说明
所以只要更改您的提要URL,您就可以开始了。Tumblr中的注释称为注释 有关详细信息,请参见-/posts-部分 对于您的特定问题,您只需在API请求时将布尔值
notes\u info
设置为true即可。例如:
通用API post请求
API要求张贴说明
因此,只要更改您的提要URL,您就可以开始了。您可以更具体一点,我到底要做什么。看起来您使用的是旧版本的API。有关新版本的详细信息,请参见我答案中的链接。我不确定旧API是否允许您阅读注释。您当前的代码将无法与新API一起工作(如果您正计划这样做的话)。您从tumblr获得了一个JSON提要,需要对其进行解析才能访问帖子和注释。您可以说得更具体一点,我到底要做什么。看起来您使用的是旧版本的API。有关新版本的详细信息,请参见我答案中的链接。我不确定旧API是否允许您阅读注释。您当前的代码将无法与新API一起工作(如果您正计划这样做的话)。您从tumblr获得一个JSON提要,需要对其进行解析才能访问帖子和笔记。有人能回答我的问题吗?有人能回答我的问题吗?
<?php
$numPosts = 5;
$feedURL = "http://#######.tumblr.com/api/read/?num=$numPosts";
$xml = @simplexml_load_file($feedURL);
foreach(@$xml->posts->post as $post){
$posts = (string) $post->{'photo-caption'};
$img = (string) $post->{'photo-url'};
echo "<div style='width:518px;height:600px;'><div style='width:518px;height:200px; float:left;'>".'<img style="width:200px;height:200px;" src="' . $img . '" />'."</div><div style='width:518px;height:300px;float:left;'>".$posts."</div></div><br>";}
?>
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'creativescripters'; // required: replace example with your forum shortname
// The following are highly recommended additional parameters. Remove the slashes in front to use.
var disqus_identifier = 'unique_dynamic_id_1234';
var disqus_url = 'http://creativescripters.com/samples/tab/tab7.html';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();