dongyu7074 2011-07-14 06:32
浏览 101
已采纳

tumblr API获取帖子的评论

 <?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);
})();

Here i am fetching the posts, but i want to fetch comments that are given to a particular post..

  • 写回答

1条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥50 寻找一位有逆向游戏盾sdk 应用程序经验的技术
  • ¥15 请问有用MZmine处理 “Waters SYNAPT G2-Si QTOF质谱仪在MSE模式下采集的非靶向数据” 的分析教程吗
  • ¥50 opencv4nodejs 如何安装
  • ¥15 adb push异常 adb: error: 1409-byte write failed: Invalid argument
  • ¥15 nginx反向代理获取ip,java获取真实ip
  • ¥15 eda:门禁系统设计
  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页
  • ¥15 376.1电表主站通信协议下发指令全被否认问题
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥15 复杂网络,变滞后传递熵,FDA