Daily Illuminator
http://www.sjgames.com/ill/
The Daily Illuminator is your daily dose of gaming news, Steve Jackson Games news, and high weirdness.en-usCopyright 2003-2017, Steve Jackson Games, Incorporated
<%perl>
my($names, $data, $dates, $idarry) = &get_news(queue=>$qname, type=>"last", count=>12);
my @illoutstr = ();
my $loopcount = 0;
foreach my $i (@{$idarry}) {
my($mo, $day, $yr) = split(/\s+/, $dates->{$i});
$day =~ s/\D+//g;
$day = substr("0$day", -2, 2);
$mo =~ s/January/01/;
$mo =~ s/February/02/;
$mo =~ s/March/03/;
$mo =~ s/April/04/;
$mo =~ s/May/05/;
$mo =~ s/June/06/;
$mo =~ s/July/07/;
$mo =~ s/August/08/;
$mo =~ s/September/09/;
$mo =~ s/October/10/;
$mo =~ s/November/11/;
$mo =~ s/December/12/;
# my $link = "http://www.sjgames.com/ill/archives.html?m=$mo&y=$yr&d=$day";
my $link = "http://www.sjgames.com/ill/a/$yr-$mo-$day";
my $name = $dates->{$i} . ": " . $names->{$i};
$illoutstr[$loopcount] = &rssify($name, $link, $data->{$i});
# Since we're adding the W23 data to the end of this item, we have to strip off the end tags.
# While we're at it, let's remove opening tags, strip HTML from the title (ugly!) and specify the GUID element.
my $titlestr = ($illoutstr[$loopcount] =~ m|(.*?)|) ? $1 : '';
$titlestr =~ s|<(.*?)>||g;
$illoutstr[$loopcount] =~ s|(.*?)|$titlestr|;
$illoutstr[$loopcount] =~ s/\s*<br><br>//;
$illoutstr[$loopcount] =~ s@(.*?)@$1\n$1@;
$illoutstr[$loopcount] =~ s/<\/description>\n<\/item>\n//;
$loopcount++;
}
($names, $data, $dates, $idarry) = &get_news(queue=>$q2, type=>"last", count=>12);
my @w23outstr = ();
$loopcount = 0;
foreach my $i (@{$idarry}) {
my $name = qq(Warehouse 23 News: $names->{$i});
$w23outstr[$loopcount] = &rssify("", "", qq(
$name
) . $data->{$i});
# Remove the beginning of this element so it'll graft nicely onto the end of the DI.
$w23outstr[$loopcount] =~ s/\n<\/title>\n<\/link>\n/<br><br>\n\n/;
$loopcount++;
}
%perl>
% for ($loopcount=0; $loopcount<12; $loopcount++) {
% my $outstr = $illoutstr[$loopcount] . $w23outstr[$loopcount];
<% $outstr %>
% }
<%doc>
The filters below clean up the output a little by converting problematic
entities. They also do their best to detect and fix double-encoded
entities like < (which should be <) and raw high-bit characters
(by encoding them as entities).
Note that this expressly converts many named entities to numeric ones, as
is proper procedure with RSS feeds. It also converts "fancy quotes" into
basic quotes and double-dashes into en-dashes, where possible, and makes
sure all BR tags are of the variety. Finally, the relative URL
used for the IllSOTW image is transformed into a full URL.
General processing:
,
, ,
, multiple BRs
(compress more than two BRs to exactly two), and remove an initial
double-BR if present.
%doc>
<%filter>
s/([\x80-\xff])/''.ord($1).';'/ge; # Translate raw high-ASCII into equivalent entities
s/\. \. \./\. \. \./g;
s/&(quot|[lr]dquo|#14[78]);/"/g;
s/"/"/g;
s/</</g;
s/>/>/g;
s/&(amp;)?#//g;
s/&(amp;)?nbsp;/ /g;
s/&(amp;)?bull;/•/g;
s/&(amp;)?auml;/ä/g;
s/&(amp;)?egrave;/è/g;
s/&(amp;)?eacute;/é/g;
s/&(amp;)?ecirc;/ê/g;
s/&(amp;)?iacute;/í/g;
s/&(amp;)?ouml;/ö/g;
s/&(amp;)?([lr]squo|#39|#14[56]);/'/g;
s//€/g;
s//‚/g;
s//ƒ/g;
s//„/g;
s/ /…/g;
s//†/g;
s//‡/g;
s//ˆ/g;
s//‰/g;
s//Š/g;
s//‹/g;
s//Œ/g;
s//Ž/g;
s//•/g;
s//–/g;
s//—/g;
s//˜/g;
s//™/g;
s//š/g;
s//›/g;
s//œ/g;
s//ž/g;
s//Ÿ/g;
s/<\/?[A-Z]>/\L$&\E/g;
s/<br \/>\s*/<br>/gi;
s/<br>-- /<br>– /g;
s/<p>\n\t/<p>/gi;
s/<p>/<br><br>/gi;
s/<\/p>/\n/gi;
s/\n<br><br>/<br><br>\n\n/g;
s/\n\t/\n/g;
s/\t/\n/g;
s/<\/(pre|ol|ul)><br><br>/<\/$1>/g;
s/<br> <br>/<br><br>/g;
s|(<br>\s*){2,}|<br><br>|g;
s|\s*(<br><br>)|$1\n\n|g;
s/(\s)--(\s)/$1–$2/g;
s|\s*||g;
s|(<a href.*?src.*?/a>)(<br>){2,}|$1|g;
s@src="/@src="http://www.sjgames.com/@g;
s/<br>/<br \/>/gi;
%filter>
<%init>
my $qname = "illq";
my $q2 = "w23";
%init>
<%once>
use SJG::Newsq;
use Date::Format;
use Date::Parse;
%once>