コンテンツを表示していないMACPIE RSS
質問
私はMagpie RSSパーサを使って別のウェブサイトに表示しようとしているブログのRSSフィードを持っています。それは「link」と 'title'のタグを正しくフェッチしますが、ブログの投稿の内容を取得しません。過去にはうまくいくようになりましたが、コンテンツはタグで囲まれていました。この場合、内容はそのようなものとして表示されます。
XML :
.
<content type="html">Test post<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/886334333339671757-1360251841923051040?l=grippofunkband.blogspot.com' alt='' /></div></content>
php
.
require_once 'rss/rss_fetch.inc';
$url = 'http://feeds.feedburner.com/grippofunkband?format=xml';
//http://grippofunkband.blogspot.com/feeds/posts/default';
$rss = fetch_rss($url);
$i = 0;
$max = 4;
foreach ($rss->items as $item ) {
$title = $item['title'];
$content = $item['content'];
$url = $item['link'];
$pubDate = $item['updated'];
echo "<li>$title<br />$url<br />$content</li>";//<a href='$url'></a>
if (++$i == $max) break;
}
誰かがなぜそれがコンテンツタグの中に何を掴んでいないのか、あるいはこの問題を回避できる方法があるならば、誰かが考えてもらえますか?あらゆる助けが大歓迎です!
解決
That's not an RSS feed. It's an Atom feed, which I think is probably your basic problem. From memory, try grabbing atom_content
instead of content
, but it may depend on the exact version of Magpie you're using.