Solved

RSS feed not displaying images

Posted on 2010-08-19
10
550 Views
Last Modified: 2013-11-18
Hi everyone, I've gotten some great help here before, and I've been stumped by a new question. Hope you can help.

I have an RSS feed that is not displaying images (found here: http://impact-photo.org/DirectorPHP/rss.php).  

I put this feed together using Slideshowpro DirectorPHP and the PHP script found here: http://www.sthomas.net/development/slideshowpro-director-rss-generator/

As you can see the feed is live and active, yet does not display images in the rss feed. I use the feed to import pictures  into a feed display on my website: www.impact-photo.org/portfolio/weddings.html (see the bottom, the photos on the left are imported from a working alternate RSS feed from wordpress),

I would love for the feed to look like this http://www.impact-photo.org/photoblog/feed/rss, so it would display images into my web page footer.

How can I tweak the feed so it displays images? Or can you recommend a feed reader that will display the media files in my page?

Thanks for all your help,

-Chris
0
Comment
Question by:ImpactPhoto
  • 4
  • 3
  • 3
10 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 33480783
This looks like an ATOM feed, not an RSS feed.  Some good info on RSS is available here:
http://cyber.law.harvard.edu/rss/rss.html
0
 

Author Comment

by:ImpactPhoto
ID: 33480789
Ok, is it possible to get images posted in this atom feed?
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 33480792
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 33480821
Sorry, I don't know much about ATOM.  I believe that it is less common than RSS.

Looking at the RSS documentation, there is a native tag for the channel image.  But that may not give you all you want.  Looking at the code snippet from http://www.impact-photo.org/photoblog/feed/rss, it looks like the description uses CDATA to insert an image tag.  This displays well in Firefox.

So my approach would be to use something like the code snippet for the platform and add your image information there.
<?xml version="1.0" encoding="UTF-8"?><rss version="0.92">
<channel>
	<title>Impact Photo &#124; Photoblog</title>
	<link>http://www.impact-photo.org/photoblog</link>
	<description></description>
	<lastBuildDate>Wed, 18 Aug 2010 00:45:29 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>

	<language>en</language>
	

	<item>
		<title>Cloud Study #6</title>
		<description><![CDATA[<img width="188" height="125" src="http://www.impact-photo.org/photoblog/wp-content/uploads/2010/08/Cloud-1-of-1-188x125.jpg" class="attachment-medium wp-post-image" alt="Cloud (1 of 1)" title="Cloud (1 of 1)" />]]></description>
		<link>http://www.impact-photo.org/photoblog/cloud-study/cloud-study-5</link>
			</item>
	<item>

		<title>Cloud Study #5</title>
		<description><![CDATA[<img width="188" height="112" src="http://www.impact-photo.org/photoblog/wp-content/uploads/2010/07/20100602-IMG_7776-Edit-188x112.jpg" class="attachment-medium wp-post-image" alt="20100602-IMG_7776-Edit" title="20100602-IMG_7776-Edit" />]]></description>
		<link>http://www.impact-photo.org/photoblog/cloud-study/cloud-study-5-2</link>
			</item>
	<item>
		<title>Cloud Study #4</title>
		<description><![CDATA[<img width="188" height="53" src="http://www.impact-photo.org/photoblog/wp-content/uploads/2010/07/Cloud-Study-4-188x53.jpg" class="attachment-medium wp-post-image" alt="Cloud Photo Fort Collins Impact Photo" title="Cloud Study #4" />Over 15 Images Stitched together to make this cloudscape. Best viewed large: Click to download full image]]></description>

		<link>http://www.impact-photo.org/photoblog/cloud-study/cloud-study-4-2</link>
			</item>
	<item>
		<title>Cloud Study #3</title>
		<description><![CDATA[<img width="188" height="125" src="http://www.impact-photo.org/photoblog/wp-content/uploads/2010/07/20100622-IMG_9059-Edit2-188x125.jpg" class="attachment-medium wp-post-image" alt="20100622-IMG_9059-Edit" title="20100622-IMG_9059-Edit" />]]></description>
		<link>http://www.impact-photo.org/photoblog/cloud-study/cloud-study-3-3</link>
			</item>

	<item>
		<title>Cloud Study #2</title>
		<description><![CDATA[<img width="188" height="125" src="http://www.impact-photo.org/photoblog/wp-content/uploads/2010/06/Cloud-Study-5-188x125.jpg" class="attachment-medium wp-post-image" alt="Cloud Study 5" title="Cloud Study 5" />]]></description>
		<link>http://www.impact-photo.org/photoblog/cloud-study/cloud-study-2-2</link>
			</item>
</channel>
</rss>

Open in new window

0
 
LVL 5

Expert Comment

by:innotionent
ID: 33485339
I figured your problem out.
The image doesn't display because it's just a link to the picture and not a image tag. so it will not show in the browser.

I've a simple xml rss parser that i use on my websites that you can use to test. And btw works great.

you need php5 to use this.
<h2>Sample</h2>



<hr size="1" noshade="noshade" />

<?php

// feed link goes here.

$file = file_get_contents("http://impact-photo.org/DirectorPHP/rss.php");

// start the xml element.

$xml = new SimpleXMLElement($file);



// print out the raw feed so you can study it. comment this out when you are done setting up your display.

echo "<pre>";

print_r($xml);

echo "</pre>";

?>



<hr size="1" noshade="noshade" />



<?php

// show some feed variables.

echo "<p>". $xml->channel->title ."<br />". $xml->channel->description ."<br />". $xml->channel->pubDate ."</p>";



// loop through the feed and configure the display however you want.

foreach($xml->channel->item as $feed){

	// show the title with a link to the image

	echo "<p><a href=\"". $feed->link ."\">". $feed->title	."</a><br />" .

	// display the image

	"<img src=\"". $feed->link ."\"><br />". 

	// here's the description and pub date.

	$feed->description." - ". $feed->pubDate." <br /> </p>";





}



?>

Open in new window

0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:ImpactPhoto
ID: 33487053
Fantastic Inno! Thanks. I feel like things are picking up, and this is all new territory for me, so I appreciate the help.

Currently I have this: http://impact-photo.org/ssp_rss/rssparser.php. What should I do next to make this feed work?

-Chris
0
 
LVL 5

Expert Comment

by:innotionent
ID: 33488987
Well. optimally. you would use that bit of code in your website to display the images.
you can change the settings for width and height in the image tag.
it's up to you.

what is your ultimate goal?
0
 

Author Comment

by:ImpactPhoto
ID: 33490393
My ultimate goal is to get the rss feed to publish to a feed reader that is displayed at the bottom of this page: http://www.impact-photo.org/portfolio/wedding.html. When I use the code as provided above, the reader does not interpret the feed and remains blank.

Thanks for your help and patients.
0
 
LVL 5

Expert Comment

by:innotionent
ID: 33505594
You know. Looking at this some more. I think you need to look at some other rss feeds online.
So you can tweek your rss code.

Look at this code from one of the Yahoo feeds.
The rss has an image tag that the image is in.

Your rss feed only references where the image is located on the web. If you put that <img src="" /> attribute in the description of your rss then the image should display.


<item>



<title>9 killed on hijacked Philippine tourist bus 

    (AP)

</title>

 <link>http://us.rd.yahoo.com/dailynews/rss/topstories/*http://news.yahoo.com/s/ap/20100823/ap_on_re_as/as_philippines_bus_hostages</link>

 

<guid isPermaLink="false">ap/20100823/as_philippines_bus_hostages</guid>



<source>AP</source>



<category>world</category>



<pubDate>Mon, 23 Aug 2010 20:25:27 GMT</pubDate>



<description>&#60;p>&#60;a href="http://us.rd.yahoo.com/dailynews/rss/topstories/*http://news.yahoo.com/s/ap/20100823/ap_on_re_as/as_philippines_bus_hostages">&#60;img src="http://d.yimg.com/a/p/ap/20100823/capt.cdd93fe7b89b447c8fa4a4d30045b3d8-cdd93fe7b89b447c8fa4a4d30045b3d8-0.jpg?x=130&amp;y=97&amp;q=85&amp;sig=_SKAlWwkKM_FfURl_x4aqg--" align="left" height="97" width="130" alt="Policemen prepare to assault the tourist bus seized by dismissed police officer Rolando Mendoza Monday, Aug. 23, 2010 at Manila&#039;s Rizal Park, Philippines. Police stormed the bus after shots were heard from the hostage-taker of 15 Chinese tourists and at least four of the  hostages crawled out of the back door. (AP Photo/Pat Roque)" border="0" />&#60;/a>AP - A 12-hour hostage drama aboard a hijacked Philippine bus ended in bloodshed Monday when an angry ex-policeman demanding his job back gunned down eight Hong Kong tourists before police stormed the vehicle and a sniper killed him.&#60;/p>&#60;br clear="all"/>

</description>



<media:content url="http://d.yimg.com/a/p/ap/20100823/capt.cdd93fe7b89b447c8fa4a4d30045b3d8-cdd93fe7b89b447c8fa4a4d30045b3d8-0.jpg?x=130&amp;y=97&amp;q=85&amp;sig=_SKAlWwkKM_FfURl_x4aqg--" type="image/jpeg" height="97" width="130"/>

<media:text type="html">&#60;p>&#60;a href="http://us.rd.yahoo.com/dailynews/rss/topstories/*http://news.yahoo.com/s/ap/20100823/ap_on_re_as/as_philippines_bus_hostages">&#60;img src="http://d.yimg.com/a/p/ap/20100823/capt.cdd93fe7b89b447c8fa4a4d30045b3d8-cdd93fe7b89b447c8fa4a4d30045b3d8-0.jpg?x=130&amp;y=97&amp;q=85&amp;sig=_SKAlWwkKM_FfURl_x4aqg--" align="left" height="97" width="130" alt="photo" title="Policemen prepare to assault the tourist bus seized by dismissed police officer Rolando Mendoza Monday, Aug. 23, 2010 at Manila&#039;s Rizal Park, Philippines. Police stormed the bus after shots were heard from the hostage-taker of 15 Chinese tourists and at least four of the  hostages crawled out of the back door. (AP Photo/Pat Roque)" border="0"/>&#60;/a>&#60;/p>&#60;br clear="all"/></media:text>



<media:credit role="publishing company">(AP)</media:credit>



</item>

Open in new window

0
 

Accepted Solution

by:
ImpactPhoto earned 0 total points
ID: 33686630
I've found another solution. You can see my feed in action at www.impact-photo.org/rss.php
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

With Wordpress gaining more and more popularity not only as blogging platform but as a shopping or CMS solution, it's worth to know which plugins are the first ones to grab and integrate with your website. We will briefly go over the most useful plu…
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now