The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Gallery::Remote - Perl extension for interacting with the Gallery remote protocol.

SYNOPSIS

  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 );

DESCRIPTION

Gallery::Remote is a perl module that allows remote access to a remote gallery.

METHODS

new( URL = "http://gallery.example.com/", USERNAME => "admin", PASSWORD => "password", VERBOSE => 0, DEBUG => 0, )>

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).

AUTHOR

Tanner Lovelace <lovelace@wayfarer.org>

SEE ALSO

Gallery - http://gallery.sf.net/