Here is a sample of the code which I know isn’t going to make much sense because the parser uses config statements in order to work. It’s almost a language by itself. In order to even run this code, you would need to get the paid version of the parser https://www.geckotribe.com/rss/carp/ because it uses plugins that are not available with the free version.
.h2 {
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 8pt;
font-weight: bold;
color:white;
text-align: center;
}
.h3 {
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 8pt;
font-weight: bold;
color:#cc0000;
text-align: center;
}
.h4 {
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 8pt;
font-weight: bold;
}
.feedbox {
width:500px;
border:1px solid blue;
border-radius: 10px;
background:#cccccc;
padding:5px;
}
.feedbox div {
background:black;
width:490px;
border:1px solid #808080;
border-radius: 10px;
padding:2px;
text-align: left;
}
.feedbox a { text-decoration:none; }
.tornado a { color:#ff0000; }
.thunder a { color:#ffa500; }
.flashflood a { color:#fd6347; }
.tsunami a { color:#fd6347; }
.hurricane1 a { color:#cd5c5c; }
.hurricane2 a { color:#ff0000; }
.storm a { color:#ee82ee; }
.blizzard a { color:#ff4500; }
.ice a { color:#ff00ff; }
.heavysnow a { color:#ee82ee; }
.tropical a { color:#ff00ff; }
.winter a { color:#ff69b4; }
.flood1 a { color:#7cfc00; }
.sleet a { color:#87ceeb; }
.flood2 a { color:#00ff00; }
.highwind a { color:#ffd700; }
.lakesnow a { color:#ee82ee; }
.heat a { color:#ff4500; }
.redflag a { color:#ff1493; }
.windchill a { color:#b0c4de; }
.avalanche a { color:#87cefa; }
.dust a { color:#ffe4c4; }
.freeze a { color:#00ffff; }
.gale a { color:#dda0dd; }
.marine a { color:#db7093; }
.spray a { color:#00bfff; }
.quake a { color:#f4a460; }
.local a { color:#ffb6c1; }
.nuke a { color:#ffff00; }
---snip ---
<?php
require_once “/xxxxx/xxxxx/xxx/xxxxx/xxxx/carp/carp.php”;
CarpConfReset();
// Show 9999 items
CarpConf(‘maxitems’,9999);
// set the CSS classes of the channel and item links
CarpConf(‘clinkclass’,‘h2’);
CarpConf(‘ilinkclass’,‘h4’);
// surround the item link with a DIV
CarpConf(‘bctitle’,‘
’);
CarpConf(‘actitle’,‘
’);
function ShowCapStuff($initem, $fieldname, $itemindex, $itemnumber, $valuearray, $returnvalue) {
$p=&$GLOBALS[‘carpconf’][‘rssparser’];
$target=$p->GetFieldValue(‘areaDesc’);
return "$target
";
}
CarpMapField(‘areadesc’,‘cap:areaDesc’);
CarpConf(‘iorder’, ‘link’);
CarpRegisterCallback(‘’,‘ShowCapStuff’,‘handlefield’,‘capstuff’);
// CarpConf(‘iorder’,‘link,desc’);
CarpConf(‘cborder’,‘’);
// CarpConf(‘cborder’,‘link’);
// CarpConf(‘cborder’,‘link,date,desc’);
CarpConf(‘linktarget’,1);
CarpConf(‘bcdate’,'Last Update: ‘);
CarpConf(‘acdate’,’
');
CarpConf(‘cdateformat’,‘M j Y \a\t g:i a T’);
CarpLoadPlugin(‘replacetext.php’);
ReplaceTextConf(1, ‘link’, 1, ‘^(.Tornado Warning.)
$’, ‘
\1
’);
ReplaceTextConf(1, ‘link’, 1, ‘^(.
Severe Thunderstorm Warning.)
$’, ‘
\1
’);
ReplaceTextConf(1, ‘link’, 1, ‘^(.
Flash Flood Warning.)
$’, ‘
\1
’);
ReplaceTextConf(1, ‘link’, 1, ‘^(.
Tsunami Warning.)
$’, ‘
\1
’);
ReplaceTextConf(1, ‘link’, 1, ‘^(.
(Inland Hurricane|Hurricane Force) Wind Warning.)
$’, ‘
\1
’);
ReplaceTextConf(1, ‘link’, 1, ‘^(.
Hurricane Warning.)
$’, ‘
\1
’);
ReplaceTextConf(1, ‘link’, 1, ‘^(.Storm Warning.
)
$', ‘\1
’);
ReplaceTextConf(1, ‘link’, 1, ‘^(.Blizzard Warning.)
$’, ‘<div class=“blizzard”">\1 ’);
ReplaceTextConf(1, ‘link’, 1, ‘^(.Ice Storm Warning.)
$’, ‘\1
’);
ReplaceTextConf(1, ‘link’, 1, ‘^(.Heavy Snow Warning.)
$’, ‘\1
’);
ReplaceTextConf(1, ‘link’, 1, ‘^(.Tropical Storm Warning.)
$’, ‘\1
’);
ReplaceTextConf(1, ‘link’, 1, ‘^(.Winter Storm Warning.)
$’, ‘\1
’);
ReplaceTextConf(1, ‘link’, 1, '^(.(Coastal|Lakeshore) Flood Warning.*)
$’, ‘
\1
’);
ReplaceTextConf(1, ‘link’, 1, ‘^(.
High Surf Warning.)
$’, ‘
\1
’);
ReplaceTextConf(1, ‘link’, 1, ‘^(.
Sleet Warning.)
$’, ‘
\1
’);
ReplaceTextConf(1, ‘link’, 1, ‘^(.
Flood Warning.)
$’, ‘
\1
’);
— snip —
ReplaceTextConf(1,‘link’,0,‘warnings or advisories’,‘warnings or advisories for San Francisco Bay Shoreline/CAZ508’);
CarpConf(‘cacheinterval’,5); // refresh the cache every 5 mins
CarpConf(‘maxcdesc’,1);
CarpConf(‘maxidesc’,0);
CarpConf(‘maxititle’,0);
CarpConf(‘maxctitle’,0);
// Display it
CarpCacheShow(“Current Watches, Warnings and Advisories for San Francisco Bay Shoreline (CAZ508) California Issued by the National Weather Service”);
?>