diff options
| author | franck cuny <franck.cuny@rtgi.fr> | 2008-12-27 13:09:50 +0100 |
|---|---|---|
| committer | franck cuny <franck.cuny@rtgi.fr> | 2008-12-27 13:09:50 +0100 |
| commit | b68bcebfa0837648bad3442ab387c89eb985fa90 (patch) | |
| tree | 4f3f65803d36e49474e01ce09619c382067b7252 | |
| parent | add ignore rules (diff) | |
| download | lifestream-b68bcebfa0837648bad3442ab387c89eb985fa90.tar.gz | |
update code template and config
| -rw-r--r-- | lifestream.pl | 10 | ||||
| -rw-r--r-- | lifestream.tt | 39 | ||||
| -rw-r--r-- | 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 @@ <div class="profile-header"> <div class="userpic"><img src="images/me.jpg" alt="franck" /></div> <div class="profile-header-content"><h1 id="page-title">franck cuny</h1></div> - <a href="http://lumberjaph.net">lumberjpah.net</a> + <a href="http://lumberjaph.net">lumberjpah.net</a><br /> + mail: franck [at] lumberjaph [dot] net<br /> + <a href="http://lumberjaph.net/blog/">blog</a><br /> + <a href="http://lumberjaph.net/code/">code</a><br /> </div> <div class="actions"> [% USE Dumper %] @@ -62,39 +65,19 @@ <div class="widget-content"> <ul class="action-stream-list"> - - <li class="service-icon icon-service-delicious"> - <a href="http://delicious.com/krynsky/" rel="me">Delicious Profile</a> + [% FOREACH profile IN profiles %] + <li class="service-icon icon-service-[% profile.source %]"> + <a href="[% profile.source_url %]" rel="me">[% profile.caption %] Profile</a> + + </li> + [% END %] - </li> - <li class="service-icon icon-service-flickr"> - <a href="http://flickr.com/photos/krynsky/" rel="me">Flickr Profile</a> + <a href="http://flickr.com/photos/franck/" rel="me">Flickr Profile</a> </li> - <li class="service-icon icon-service-googlereader"> - <a href="http://www.google.com/reader/shared/01549324099173237561" rel="me">Google Reader Profile</a> - - </li> - - <li class="service-icon icon-service-lastfm"> - <a href="http://www.last.fm/user/krynsky/" rel="me">Last.fm Profile</a> - - </li> - - - <li class="service-icon icon-service-identica"> - <a href="http://identi.ca/franck" rel="me">Identica Profile</a> - - </li> - - - <li class="service-icon icon-service-myblog"> - <a href="http://lumberjaph.net/blog/" rel="me">my blog</a> - - </li> </ul> 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 |
