7 use HTML5TV::hCalendar;
11 my $url = 'http://html5tv.rot13.org';
13 my $html = qq|<!DOCTYPE html>
17 <meta charset="utf-8" />
19 <link rel="alternate" type="application/rss+xml" title="RSS" href="calendar.xml">
21 <link rel="icon" type="image/png" href="media/favicon.png">
23 <script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
25 <script src="js/jqueryhcal/jqueryhcal.js" type="text/javascript"></script>
26 <link rel="stylesheet" type="text/css" href="js/jqueryhcal/jqueryhcal.css" />
28 <link rel="stylesheet" type="text/css" href="css/hCalendar.css" />
29 <style type="text/css">
37 <title>HTML5TV all media available</title>
43 <div id="jhCalendar"></div>
48 my $feed = XML::FeedPP::RSS->new;
49 $feed->title( 'HTML5TV' );
52 foreach my $path ( glob 'media/*/hCalendar.html' ) {
53 next if $path =~ m{_editing};
56 my $hcal = HTML5TV::hCalendar->new( $path );
58 my $media = (split(/\//, $path))[1];
60 if ( ! -e "www/$media.html" ) {
61 warn "NO www/$media.html $!";
65 my $html = $hcal->as_HTML(
66 [ 'span', { class => 'watch' },
67 [ 'a', { href => "$media.html", title => $media, },
68 [ 'img', { src => 'media/favicon.png', border => 0 } ],
73 $vevents->{ $hcal->dtstart_iso } = $html;
75 my $pubDate = $hcal->dtstart_iso;
76 $pubDate =~ s{^(\d\d\d\d)(\d\d)(\d\d).*$}{$1-$2-$3};
78 my $item = $feed->add_item( "$url/$media.html" );
79 $item->title( $hcal->summary );
80 $item->pubDate( $pubDate );
81 $item->description( $html );
84 $feed->to_file( 'www/calendar.xml' );
86 $html .= join("\n", map { $vevents->{$_} } sort keys %$vevents );
90 <a href="calendar.xml">rss</a>
97 write_file 'www/calendar.html', $html;