【问题标题】:Get element in the channel of the feed with SimplePie in Wordpress?在 Wordpress 中使用 SimplePie 获取提要频道中的元素?
【发布时间】:2012-12-18 23:02:59
【问题描述】:

我应该如何使用get_channel_tags() 或者我应该使用 SimplePie 的什么功能来获取 YouTube rss 播放列表或提要的频道/标题部分中的其他元素/属性的 totalResults?

播放列表示例:http://gdata.youtube.com/feeds/api/playlists/PL25BD62C6275E88F6?alt=rss

这不起作用:

$totalResults = $rss->get_channel_tags('http://a9.com/-/spec/opensearchrss/1.0/', 'totalResults');
$totalResultsData = $totalResults[0];

【问题讨论】:

    标签: wordpress youtube simplepie


    【解决方案1】:

    我没有让它工作,但如果我使用 Atom 提要,它可以与函数 get_feed_tags() 一起工作。

    这行得通:

    播放列表: http://gdata.youtube.com/feeds/api/playlists/PL25BD62C6275E88F6?alt=atom (默认使用 ?alt=atom 参数,可以删除)

    $totalResults = $rss->get_feed_tags('http://a9.com/-/spec/opensearch/1.1/', 'totalResults');
    $totalResultsData = $totalResults[0]['data']; 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多