#! /usr/bin/perl -w
use strict;
use warnings;
use diagnostics;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use lib ('./perllib');
use XML::Simple;
use Data::Dumper;
use LWP::Simple;
my $file = 'http://www.opusforum.org/rmg/tel/index.rss';
my $content = get($file); 
my $cgi = CGI->new();
print $cgi->header(-type => 'text/html');
my $jobs_h = XMLin($content);
my $jobs = ();
foreach(keys(%$jobs_h)){
  if($_ eq 'item'){
    $jobs = $jobs_h->{$_};
    last;
  }
}
foreach my $job(@$jobs){
  #my $jobtitle = $cgi->escapeHTML($job->{title});
  my $jobtitle = $job->{title};
  if($jobtitle =~ /ö/){
    print "yes
";
  $jobtitle =~ s%ö%\ö%ge;
  $jobtitle =~ s%ä%\ä%ge;
  $jobtitle =~ s%ß%\ß%ge;
  $jobtitle =~ s%ü%\ü%ge;
  $jobtitle =~ s%Ä%\Ä%ge;
  $jobtitle =~ s%Ö%\Ö%ge;
  $jobtitle =~ s%Ü%\Ü%ge;
  }
  print $cgi->a({-href => $job->{link}, -target => '_blank'}, $jobtitle);
  print "
\n";
}