Strip RSS images

Asked by Stephen Roddick

I'm wondering if there is any plan (and suggesting it might be a good idea) to include an option in the ticker creation/edit to have the ticker not display images?

I have several RSS Feeds that include img tags in their CDATA (most notably http://rss.cbc.ca/lineup/topstories.xml). In doing so the image renders at full size with the text appearing at it's bottom right (as the img tag is first in CDATA). It means that when I make a short and wide region (generally at the bottom of a display) only the top of the image is displayed (as the text is below the bottom of the reigon).

I have created a PHP page to parse out img tags (see below) but would like it if something like it is included in the xibo code so the ticker can do this natively.

alternatly the code could be modified to add/modify the hieght and width to scale just the the images

-=-=-=- CODE -=-=-=-

<?php
 // File: imglessrss.php
 // Notes: This PHP file is intended to strip image tags from the CDATA of RSS items.
 // Usage: http://<path>/imglessrss.php?rssurl=<rss url>
 $lines = file($_GET["rssurl"]);
 foreach ($lines as $line_num => $line) {
  if (strpos ($line,"<img") === false) {
   echo $line;
  } else {
   echo preg_replace("/<img[^>]+\>/i", "", $line);
  }
 }
?>

Question information

Language:
English Edit question
Status:
Answered
For:
Xibo Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Shaun (sjones) said :
#1

I'd like add my name on this feature request. Seems alot of feeds add images these days. Plays havok with a ticker.

Revision history for this message
Mike H (s-mike-s) said :
#2

In ver 1.4.2 did you test the link with the "ticker option" in the layout. I don't think image is a parm it reads.
Later

Revision history for this message
Shaun (sjones) said :
#3

Added xml feed in url field in rss ticker option. ( http://rss.cbc.ca/lineup/topstories.xml)
This displayed just the tops of images no text ,as is commonly done in a ticker bar at the bottom of a page.
Either an option to resize images or to strip would be wonderful.

Revision history for this message
Roel Vliegen (r-vliegen) said :
#4

It's quite a time ago but I hope I can help someone with my answer.
For stripping images from the RSS feed I use the CSS code below:

<style type="text/css">
<!--
IMG {
display: none;
}
a {
display: none;
}
-->
</style>

I do the same for striping links as you see in the above code.

I paste this code before the text in de code view of the ticker. Simple but effective.

Can you help with this problem?

Provide an answer of your own, or ask Stephen Roddick for more information if necessary.

To post a message you must log in.