#!/usr/bin/perl
###########################################
# bild2rss - bild.de as *.rss  
# Mike Schilli, 2004 (m@perlmeister.com)
###########################################
use warnings;
use strict;

use RssMaker;
use Log::Log4perl qw(:easy);

Log::Log4perl->easy_init($INFO);

my $url = "http://www.bild.t-online.de/" .
          "BTO/Startseite/StartBuehne," .
          "templateId=renderKomplett.html";

RssMaker::make(
  url    => $url,
  title  => "Bildzeitung",
  filter => sub {
    my($link, $text) = @_;
    if($link =~ /javascript/) {
      if($link =~ /'(http:\/.*?)'/) {
        $link = $1;
        $_[0] = $link;
      } else {
        return 0;
      }
    }
    $_[1] =~ s/[^[:print:]äöüÄÖÜß]//g;
    $link =~ m#BTO#i ? 1 : 0;
  },
  output => "bild.rss",
  encoding => "iso-8859-1");
