Gallery::Remote - Perl extension for interacting with the Gallery remote protocol.
use Gallery::Remote; # Instatiate a new Gallery::Remote object my $remote_gallery = Gallery::Remote->new(URL => 'http://www.example.com/gallery/', USERNAME => 'admin', PASSWORD => 'password'); $remote_gallery->login(); # Get an array of hash information about remote albums. my $album_data = $remote_gallery->fetch_albums_prune(); if ($album_data) { print "Albums found: " . scalar(@$album_data) . "\n"; } else { print "No albums found.\n"; } # Go through and find all album data. foreach my $album_entry (@$album_data) { foreach my $key (keys %$album_entry) { print "Found: album_entry{$key} = $$album_entry{$key}\n"; } } my $parms = {}; my $picparms = {}; $$parms{name} = "test"; $$parms{title} = "A test of Gallery::Remote"; $$parms{desc} = "I'm testing out my perl script"; my $parent_album = $remote_gallery->new_album( %$parms ); $parms = {}; $$parms{parent} = $parent_album; $$parms{title} = "Test Album"; $$parms{desc} = "Sub album test"; $$parms{name} = "test2"; my $new_album_name = $remote_gallery->new_album( %$parms ); print "Created new album: $new_album_name under parent album $parent_album\n"; $$picparms{set_albumName} = $new_album_name; $$picparms{userfile} = [ "./example.jpg" ]; $$picparms{userfile_name} = "example.jpg"; $$picparms{caption} = "Testing Gallery::Remote"; $remote_gallery->add_item( %$picparms );
Gallery::Remote is a perl module that allows remote access to a remote gallery.
The new() method specifies the remote gallery and a username and pasword combination to log in with. You can optionally specify verbose operation or debug (which will print out a lot of information).
Tanner Lovelace <lovelace@wayfarer.org>
Gallery - http://gallery.sf.net/
To install Gallery::Remote, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gallery::Remote
CPAN shell
perl -MCPAN -e shell install Gallery::Remote
For more information on module installation, please visit the detailed CPAN module installation guide.