From b68bcebfa0837648bad3442ab387c89eb985fa90 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Sat, 27 Dec 2008 13:09:50 +0100 Subject: update code template and config --- lifestream.pl | 10 ++++++++-- lifestream.tt | 39 +++++++++++---------------------------- lifestream.yaml | 45 ++++++++++++++++++++++++++------------------- 3 files changed, 45 insertions(+), 49 deletions(-) diff --git a/lifestream.pl b/lifestream.pl index 891e945..9423cc5 100644 --- a/lifestream.pl +++ b/lifestream.pl @@ -7,10 +7,10 @@ use YAML::Syck; use URI; use Template; -my $feeds = LoadFile( shift ); +my $config = LoadFile( shift ); my $hash_entries; -foreach ( @$feeds ) { +foreach ( @{$config->{actions}} ) { my $feed = XML::Feed->parse( URI->new( $_->{ url } ) ); for my $e ( $feed->entries ) { my $date = $e->issued->strftime( '%Y.%m.%d' ); @@ -29,6 +29,12 @@ my @dates = keys %$hash_entries; my @sorted_dates = sort { $a cmp $b } @dates; my $hash_templates; +for my $type ( 'profiles', 'actions' ) { + foreach my $profile ( @{ $config->{ $type } } ) { + push @{ $hash_templates->{ profiles } }, $profile; + } +} + foreach my $date ( reverse @sorted_dates ) { my @actions = sort { $b->{ date } cmp $a->{ date } } @{ $hash_entries->{ $date } }; diff --git a/lifestream.tt b/lifestream.tt index 844ace2..4073aa5 100644 --- a/lifestream.tt +++ b/lifestream.tt @@ -22,7 +22,10 @@
franck

franck cuny

- lumberjpah.net + lumberjpah.net
+ mail: franck [at] lumberjaph [dot] net
+ blog
+ code
[% USE Dumper %] @@ -62,39 +65,19 @@
diff --git a/lifestream.yaml b/lifestream.yaml index 79944e2..be66801 100644 --- a/lifestream.yaml +++ b/lifestream.yaml @@ -1,19 +1,26 @@ -- - source: delicious - url: http://feeds.delicious.com/v2/rss/franck?count=20 - source_url: http://delicious.com/franck -- - source: identica - url: http://identi.ca/api/statuses/user_timeline/franck.atom - source_url: http://identi.ca/franck -- - source: googlereader - url: http://www.google.com/reader/public/atom/user%2F17077268849154926648%2Fstate%2Fcom.google%2Fbroadcast -- - source: myblog - url: http://lumberjaph.net/blog/index.php/feed/ - source_url: http://lumberjaph.net/blog/ -- - source: lastfm - url: http://ws.audioscrobbler.com/1.0/user/franckcuny/recenttracks.rss - source_url: http://www.last.fm/user/franckcuny +actions: + - + source: delicious + url: http://feeds.delicious.com/v2/rss/franck?count=20 + source_url: http://delicious.com/franck + caption: Delicious + - + source: identica + url: http://identi.ca/api/statuses/user_timeline/franck.atom + source_url: http://identi.ca/franck + caption: Identi.ca + - + source: googlereader + url: http://www.google.com/reader/public/atom/user%2F17077268849154926648%2Fstate%2Fcom.google%2Fbroadcast + source_url: https://www.google.com/reader/shared/17077268849154926648 + caption: Google Reader + - + source: myblog + url: http://lumberjaph.net/blog/index.php/feed/ + source_url: http://lumberjaph.net/blog/ + caption: My Blog +profiles: + - + source: lastfm + url: http://www.last.fm/user/franckcuny/ + caption: Last.fm -- cgit 1.4.1