duanhan5388 2012-10-09 08:52
浏览 13

无法检索rss供稿

I'm trying to retrieve RSS feeds data from the urls with the below php coding, it returns me the required data like item title,item description, item date etc. But when i try to retrieve the rss feeds data for the below URLS with the same php coding it returns no data. We don't know what is blocking us to retrieve data from below blogs.

Please help us to fix this problem and we can retrieve rss feeds data from the below blog urls.

[1] : http://kuwait-music.com

[2] : www.w6n.cc




<?php         
require_once "simplepie.inc";         
$mfeed = [1] :  http://kuwait-music.com;         
$feedinstance = new SimplePie();         
$feedinstance-->set_feed_url($mfeed);         
$feedinstance-->init();         
$feedinstance-->handle_content_type();         
echo $feedinstance-->get_permalink();         
echo $feedinstance-->get_title();          
echo $feedinstance-->get_description();         
$count = 0;            
foreach($feedinstance-->get_items() as $item)    
{            
  echo $item-->get_permalink();            
  echo $item-->get_title();             
  echo $item-->get_description();            
  echo $item-->get_date();           
  $count++;            
  if ($count == 1) break;
}
?>
  • 写回答

1条回答 默认 最新

  • doubeng9407 2012-10-12 22:45
    关注

    I think it might have something to do with using SimplePie 1.3, but when I changed the format of the first few lines and added a set_feed_url line for each item, it seemed to work fine. It works now after this change.

    评论

报告相同问题?

悬赏问题

  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?