root/trunk/plagger/lib/Plagger/Plugin/Subscription/BrowserHistory/Safari.pm

Revision 1932 (checked in by franck, 2 years ago)

plugin Plagger::Plugin::Subscription::BrowserHistory?
tests cases, deps, and some samples files
mozilla-history.dat from the File::Mork package by Simon Wistow
idea from ticket http://plagger.org/trac/ticket/377

Line 
1 package Plagger::Plugin::Subscription::BrowserHistory::Safari;
2 use strict;
3 use base qw( Plagger::Plugin::Subscription::BrowserHistory );
4 use Mac::Tie::PList;
5
6 use URI::file;
7                
8 sub load {
9     my ( $self, $context ) = @_;
10
11     $self->conf->{ url } = URI::file->new( $self->conf->{ path } );
12
13     my $plist = Mac::Tie::PList->new_from_file( $self->conf->{ path } );
14
15         foreach my $entry (@{$plist->{WebHistoryDates}}){
16                 my $feed = Plagger::Feed->new;
17         $feed->url( $entry->{''} );
18         $feed->title( $entry->{title} );
19         $context->subscription->add( $feed );
20         }
21 }
22
23 1;
Note: See TracBrowser for help on using the browser.