my $TEST = 0;
my $SITESFILE = "sites";
+my $CACHEDIR = "cache/";
my $t = shift @ARGV;
if ($t eq '--test') {
$TEST=1;
$SITESFILE = "sites.test";
+ $CACHEDIR = "cache.test/";
}
print "Connecting...\n";
$conn->{status} = "wait"; # "wait" or "check" states
$conn->{oldtime} = time;
$conn->{newtime} = time;
-my $cachedir = "cache/";
+mkdir $CACHEDIR unless -d $CACHEDIR;
my @sites;
my $hupflag = 0;
sub read_cache($) {
my ($name) = shift;
my ($fh, $cachelink);
- my $cachefile = $cachedir."/".$name;
+ my $cachefile = $CACHEDIR."/".$name;
my @rv;
return undef if( ! -e $cachefile );
open($fh, $cachefile) or die ("Cant open cachefile: $!");
# args: name, cachelink [,link [,link ...]]
# so @_ is now the new cache. OVERWRITES what's already there!
my $fh;
- my $cachefile = $cachedir."/".$name;
+ my $cachefile = $CACHEDIR."/".$name;
open($fh, ">", $cachefile) or die ("Can't open cachefile: $!");
print $fh $_.$/ for (@_);
close($fh);
--- /dev/null
+# SYNTAX:
+# channel;feedshortname;colour;url
+# NB that channel must have no leading '#' or it will be mistaken
+# for a comment!
+#
+# FIXME: TODO: Reinstate the proper URL-encoding in the bot.
+#
+beeb;bbc-uk;0;http://feeds.bbci.co.uk/news/uk/rss.xml?edition=uk
+beeb;bbc-world;0;http://feeds.bbci.co.uk/news/world/rss.xml
+beeb;bbc-biz;0;http://feeds.bbci.co.uk/news/business/rss.xml
+beeb;bbc-sci;0;http://feeds.bbci.co.uk/news/science_and_environment/rss.xml
+beeb;bbc-tech;0;http://feeds.bbci.co.uk/news/technology/rss.xml
+#
+# Now that we report by guid, rather than by link, the BBC weather forecasts can work without a logic facelift:
+weather;Cambridge;2;http://newsrss.bbc.co.uk/weather/forecast/324/ObservationsRSS.xml
+weather;Cambridge;2;http://newsrss.bbc.co.uk/weather/forecast/324/Next3DaysRSS.xml
+weather;Oxford;3;http://newsrss.bbc.co.uk/weather/forecast/25/ObservationsRSS.xml
+weather;Oxford;3;http://newsrss.bbc.co.uk/weather/forecast/25/Next3DaysRSS.xml
+#
+# OTOH the Met Office site, at least the warnings, have serial numbers...
+weather;meto-ee-warnings;2;http://www.metoffice.gov.uk/xml/warnings_rss_ee.xml
+weather;meto-se-warnings;3;http://www.metoffice.gov.uk/xml/warnings_rss_se.xml