Hi,
I was wondering if someone could point me in the right direction on how to add images to my feed using Magpie RSS. Is there some kind of tag that i would need to add like $item[image] or something? Thanks!
Hi,
I was wondering if someone could point me in the right direction on how to add images to my feed using Magpie RSS. Is there some kind of tag that i would need to add like $item[image] or something? Thanks!
The <channel> element may include an <image> element. See this specification section for more info.
Exellent. Thanks for the help. I have something like this using magpierss and was trying to echo out the images with the stories like google does.
<?php
require_once 'rss_fetch.inc';
$url = 'http://news.google.com/news?hl=en&ned=us&q=thanksgiving&ie=UTF-8&output=rss';
$num_items = 5;
$rss = fetch_rss($url);
$items = array_slice($rss->items, 0, $num_items);
echo "Site: ", $rss->channel['title'], "<br>
";
foreach ($items as $item ) {
$title = $item[title];
$url = $item[link];
echo "<a href=$url>$title</a></li><br>
";
}
?>
kampbell411 wrote:echo "Site: ", $rss->channel['title'], "<br>
";
foreach ($items as $item ) {
$title = $item[title];
$url = $item[link];
echo "<a href=$url>$title</a></li><br>
";
}
?>
I actually figured this out and thought i should maybe post the answer to the question i posted.
-The image is actually embedded in the item summary or description in most feeds.
so you would just add $summary = $item[summary] and then echo it out wherever.