root/trunk/plagger/lib/Plagger/Plugin/Subscription/BrowserHistory/Mozilla.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::Mozilla;
2 use strict;
3 use base qw( Plagger::Plugin::Subscription::BrowserHistory );
4 use File::Mork;
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 $mork = File::Mork->new( $self->conf->{ path }, verbose => 1 )
14         || $context->log(error => $File::Mork::ERROR);
15
16     foreach my $entry ( $mork->entries ) {
17         my $feed = Plagger::Feed->new;
18         $feed->url( $entry->URL );
19         $feed->title( $entry->Name );
20         $context->subscription->add( $feed );
21     }
22 }
23
24 1;
Note: See TracBrowser for help on using the browser.