projects
/
HTML5TV.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3385ed5
)
include style in each rss entry
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sat, 12 Dec 2009 17:05:11 +0000
(18:05 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sat, 12 Dec 2009 17:05:11 +0000
(18:05 +0100)
bin/calendar.pl
patch
|
blob
|
history
diff --git
a/bin/calendar.pl
b/bin/calendar.pl
index
3a5a100
..
71ab065
100755
(executable)
--- a/
bin/calendar.pl
+++ b/
bin/calendar.pl
@@
-7,9
+7,24
@@
use lib 'lib';
use HTML5TV::hCalendar;
use File::Slurp;
use XML::FeedPP;
use HTML5TV::hCalendar;
use File::Slurp;
use XML::FeedPP;
+use HTML::ResolveLink;
my $url = 'http://html5tv.rot13.org';
my $url = 'http://html5tv.rot13.org';
+my $style = qq|
+<style type="text/css">
+
+|
+. read_file('www/css/hCalendar.css')
+. qq|
+
+.watch {
+ margin-right: 0.1em;
+}
+
+</style>
+|;
+
my $html = qq|<!DOCTYPE html>
<html>
my $html = qq|<!DOCTYPE html>
<html>
@@
-26,13
+41,8
@@
my $html = qq|<!DOCTYPE html>
<link rel="stylesheet" type="text/css" href="js/jqueryhcal/jqueryhcal.css" />
<link rel="stylesheet" type="text/css" href="css/hCalendar.css" />
<link rel="stylesheet" type="text/css" href="js/jqueryhcal/jqueryhcal.css" />
<link rel="stylesheet" type="text/css" href="css/hCalendar.css" />
-<style type="text/css">
-
-.watch {
- margin-right: 0.1em;
-}
-</style>
+$style
<title>HTML5TV all media available</title>
<title>HTML5TV all media available</title>
@@
-49,6
+59,8
@@
my $feed = XML::FeedPP::RSS->new;
$feed->title( 'HTML5TV' );
$feed->link( $url );
$feed->title( 'HTML5TV' );
$feed->link( $url );
+my $resolver = HTML::ResolveLink->new( base => $url );
+
foreach my $path ( glob 'media/*/hCalendar.html' ) {
next if $path =~ m{_editing};
warn "+ $path\n";
foreach my $path ( glob 'media/*/hCalendar.html' ) {
next if $path =~ m{_editing};
warn "+ $path\n";
@@
-78,7
+90,7
@@
foreach my $path ( glob 'media/*/hCalendar.html' ) {
my $item = $feed->add_item( "$url/$media.html" );
$item->title( $hcal->summary );
$item->pubDate( $pubDate );
my $item = $feed->add_item( "$url/$media.html" );
$item->title( $hcal->summary );
$item->pubDate( $pubDate );
- $item->description( $
html
);
+ $item->description( $
style . $resolver->resolve( $html )
);
}
$feed->to_file( 'www/calendar.xml' );
}
$feed->to_file( 'www/calendar.xml' );