Permalink
Browse files

Issue #5: fetching of albums

Added the possibility to fetch albums only.
Also Version is now prepared for v0.09 and requires Ipernity::API v0.10
as v0.09 has a serious bug which makes it impossible to fetch an
authtoken
  • Loading branch information...
1 parent d03568f commit 8cf427074f4c598b96b8be3f7904127d933ab56a @wneessen committed Jan 13, 2011
Showing with 16 additions and 7 deletions.
  1. +5 −0 Changelog
  2. +7 −5 IperBackup.pl
  3. +4 −2 IperBackup/Process.pm
View
@@ -1,3 +1,8 @@
+IperBackup v0.09 // 2011-01-XX
+==============================
+- Added possibility to fetch albums
+- IperBackup requires Ipernity::API 0.10 now
+
IperBackup v0.08 // 2011-01-07
==============================
- Default config file path is ./IperBackup.conf instead of
View
@@ -6,15 +6,14 @@
#
# $Id$
#
-# Last modified: [ 2011-01-05 16:24:00 ]
+# Last modified: [ 2011-01-13 13:47:12 ]
## This is the IperBackup::Main package {{{
package IperBackup::Main;
### Global modules {{{
use strict;
use warnings;
-#use Data::Dumper; ## Debug only
use Date::Manip;
use Getopt::Long;
use IperBackup::Config;
@@ -30,7 +29,7 @@ package IperBackup::Main;
use constant EXT_DEBUG => 0; ## Enable extended debug-logging
use constant LOGLEVEL => 'INFO'; ## Set the log level
use constant OUTDIR => '/var/tmp'; ## Default output directory
-use constant VERSION => '0.08'; ## Current version number
+use constant VERSION => '0.09'; ## Current version number
# }}}
## Define global variables {{{
@@ -54,8 +53,8 @@ BEGIN
{
my $API = $Ipernity::API::VERSION;
- do{ print "Ipernity::API v0.09 or higher required.\n"; exit 127; }
- unless( $API >= 0.09 );
+ do{ print "Ipernity::API v0.10 or higher required.\n"; exit 127; }
+ unless( $API >= 0.10 );
}
# }}}
@@ -112,6 +111,7 @@ sub main
enddate => $config->{ 'enddate' } || undef,
nopermission => $config->{ 'nopermission' } || undef,
timestamp => $config->{ 'timestamp' } || undef,
+ album => $config->{ 'album' } || undef,
);
# }}}
@@ -286,6 +286,7 @@ sub getArgs
'nopermission|p'=> \$config->{ 'nopermission' },
'timestamp|ts' => \$config->{ 'timestamp' },
'version|v' => \$config->{ 'version' },
+ 'album|a=s' => \$config->{ 'album' },
);
@@ -349,6 +350,7 @@ sub showHelp
## Print message
print "Usage: $0 [OPTIONS]\n";
+ print "\n\t-a, --album\t\tSpecify an album ID to let IperBackup only fetch documents from that album";
print "\n\t-c, --config\t\tSpecify absolute path to config file (Default: /etc/IperBackup.conf)";
print "\n\t--comentsonly\t\tDownload comments only";
print "\n\t-d, --download\t\tTell IperBackup to download all files in your account";
View
@@ -6,7 +6,7 @@
#
# $Id$
#
-# Last modified: [ 2011-01-05 00:50:50 ]
+# Last modified: [ 2011-01-13 13:47:27 ]
## This is the IperBackup::Process package {{{
package IperBackup::Process;
@@ -17,7 +17,6 @@ use strict;
use Carp qw( carp croak );
use Date::Manip;
use Encode;
-#use Data::Dumper;
use Time::HiRes;
# }}}
@@ -49,6 +48,7 @@ sub new
$self->{ 'enddate' } = delete( $args{ 'enddate' } );
$self->{ 'nopermission' } = delete( $args{ 'nopermission' } );
$self->{ 'timestamp' } = delete( $args{ 'timestamp' } );
+ $self->{ 'album' } = delete( $args{ 'album' } );
## API object needs to be provided
unless( defined( $self->{ 'api' } ) )
@@ -126,6 +126,7 @@ sub getNumberDocs
method => 'user.get',
media => $self->{ 'media' },
tags => $self->{ 'tags' } || undef,
+ album_id => $self->{ 'album' } || undef,
auth_token => $self->{ 'config' }->{ 'IPER_API_AUTHTOKEN' },
);
@@ -297,6 +298,7 @@ sub getNumberPages
user_id => $self->getUserInfo( 'user_id' ),
media => $self->{ 'media' },
tags => $self->{ 'tags' } || undef,
+ album_id => $self->{ 'album' } || undef,
auth_token => $self->{ 'config' }->{ 'IPER_API_AUTHTOKEN' },
posted_min => UnixDate( $self->{ 'startdate' } || '1970-01-01 00:00:00 UTC', '%s' ),
posted_max => UnixDate( $self->{ 'enddate' } || 'now', '%s' ),

0 comments on commit 8cf4270

Please sign in to comment.