r25969 - in /branches/upstream/libflickr-api-perl/current: Changes MANIFEST META.yml Makefile.PL README lib/Flickr/API.pm lib/Flickr/API/Request.pm test.pl
gwolf at users.alioth.debian.org
gwolf at users.alioth.debian.org
Sun Oct 12 17:19:22 UTC 2008
Author: gwolf
Date: Sun Oct 12 17:19:20 2008
New Revision: 25969
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=25969
Log:
[svn-upgrade] Integrating new upstream version, libflickr-api-perl (1.01)
Added:
branches/upstream/libflickr-api-perl/current/Changes
Modified:
branches/upstream/libflickr-api-perl/current/MANIFEST
branches/upstream/libflickr-api-perl/current/META.yml
branches/upstream/libflickr-api-perl/current/Makefile.PL
branches/upstream/libflickr-api-perl/current/README
branches/upstream/libflickr-api-perl/current/lib/Flickr/API.pm
branches/upstream/libflickr-api-perl/current/lib/Flickr/API/Request.pm
branches/upstream/libflickr-api-perl/current/test.pl
Added: branches/upstream/libflickr-api-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libflickr-api-perl/current/Changes?rev=25969&op=file
==============================================================================
--- branches/upstream/libflickr-api-perl/current/Changes (added)
+++ branches/upstream/libflickr-api-perl/current/Changes Sun Oct 12 17:19:20 2008
@@ -1,0 +1,9 @@
+Changes to Flickr::API
+
+0.10, 2008-09-29
+ * Work correctly with latest XML::Parser::Lite::Tree (now requires 0.06)
+ * Added patch from Flavio Poletti to allow custom api & auth urls
+
+1.01, 2008-09-30
+ * incorrectly numbered the previous release. gah
+ * updated tests to work when the flickr api isn't hit-able
Modified: branches/upstream/libflickr-api-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libflickr-api-perl/current/MANIFEST?rev=25969&op=diff
==============================================================================
--- branches/upstream/libflickr-api-perl/current/MANIFEST (original)
+++ branches/upstream/libflickr-api-perl/current/MANIFEST Sun Oct 12 17:19:20 2008
@@ -5,4 +5,5 @@
MANIFEST
README
test.pl
+Changes
META.yml Module meta-data (added by MakeMaker)
Modified: branches/upstream/libflickr-api-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libflickr-api-perl/current/META.yml?rev=25969&op=diff
==============================================================================
--- branches/upstream/libflickr-api-perl/current/META.yml (original)
+++ branches/upstream/libflickr-api-perl/current/META.yml Sun Oct 12 17:19:20 2008
@@ -1,7 +1,7 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Flickr-API
-version: 0.09
+version: 1.01
version_from: lib/Flickr/API.pm
installdirs: site
requires:
@@ -11,7 +11,7 @@
LWP::UserAgent: 0
Test::More: 0
URI: 1.18
- XML::Parser::Lite::Tree: 0.03
+ XML::Parser::Lite::Tree: 0.06
distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+generated_by: ExtUtils::MakeMaker version 6.30
Modified: branches/upstream/libflickr-api-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libflickr-api-perl/current/Makefile.PL?rev=25969&op=diff
==============================================================================
--- branches/upstream/libflickr-api-perl/current/Makefile.PL (original)
+++ branches/upstream/libflickr-api-perl/current/Makefile.PL Sun Oct 12 17:19:20 2008
@@ -8,7 +8,7 @@
'HTTP::Request' => 0,
'HTTP::Response' => 0,
'URI' => 1.18,
- 'XML::Parser::Lite::Tree' => 0.03,
+ 'XML::Parser::Lite::Tree' => 0.06,
'Digest::MD5' => 0,
'Test::More' => 0,
},
Modified: branches/upstream/libflickr-api-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libflickr-api-perl/current/README?rev=25969&op=diff
==============================================================================
--- branches/upstream/libflickr-api-perl/current/README (original)
+++ branches/upstream/libflickr-api-perl/current/README Sun Oct 12 17:19:20 2008
@@ -29,6 +29,6 @@
COPYRIGHT AND LICENCE
-Copyright (C) 2004-2006 Cal Henderson <cal at iamcal.com>
+Copyright (C) 2004-2008 Cal Henderson <cal at iamcal.com>
License: Perl Artistic License
Modified: branches/upstream/libflickr-api-perl/current/lib/Flickr/API.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libflickr-api-perl/current/lib/Flickr/API.pm?rev=25969&op=diff
==============================================================================
--- branches/upstream/libflickr-api-perl/current/lib/Flickr/API.pm (original)
+++ branches/upstream/libflickr-api-perl/current/lib/Flickr/API.pm Sun Oct 12 17:19:20 2008
@@ -10,14 +10,16 @@
our @ISA = qw(LWP::UserAgent);
-our $VERSION = '0.09';
+our $VERSION = '1.01';
sub new {
my $class = shift;
my $options = shift;
my $self = new LWP::UserAgent;
- $self->{api_key} = $options->{key};
- $self->{api_secret} = $options->{secret};
+ $self->{api_key} = $options->{key};
+ $self->{api_secret} = $options->{secret};
+ $self->{rest_uri} = $options->{rest_uri} || 'http://www.flickr.com/services/rest/';
+ $self->{auth_uri} = $options->{auth_uri} || 'http://www.flickr.com/services/auth/';
eval {
require Compress::Zlib;
@@ -65,7 +67,7 @@
my $sig = $self->sign_args(\%args);
$args{api_sig} = $sig;
- my $uri = URI->new('http://flickr.com/services/auth');
+ my $uri = URI->new($self->{auth_uri});
$uri->query_form(%args);
return $uri;
@@ -74,7 +76,7 @@
sub execute_method {
my ($self, $method, $args) = @_;
- my $request = new Flickr::API::Request({'method' => $method, 'args' => $args});
+ my $request = new Flickr::API::Request({'method' => $method, 'args' => $args, rest_uri => $self->{rest_uri}});
$self->execute_request($request);
}
@@ -133,7 +135,7 @@
sub _find_tag {
my ($self, $children) = @_;
for my $child(@{$children}){
- return $child if $child->{type} eq 'tag';
+ return $child if $child->{type} eq 'element';
}
return {};
}
Modified: branches/upstream/libflickr-api-perl/current/lib/Flickr/API/Request.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libflickr-api-perl/current/lib/Flickr/API/Request.pm?rev=25969&op=diff
==============================================================================
--- branches/upstream/libflickr-api-perl/current/lib/Flickr/API/Request.pm (original)
+++ branches/upstream/libflickr-api-perl/current/lib/Flickr/API/Request.pm Sun Oct 12 17:19:20 2008
@@ -6,18 +6,20 @@
use URI;
our @ISA = qw(HTTP::Request);
-our $VERSION = '0.02';
+our $VERSION = '0.03';
sub new {
my $class = shift;
+ my $options = shift;
my $self = new HTTP::Request;
- my $options = shift;
- $self->{api_method} = $options->{method};
- $self->{api_args} = $options->{args};
+ $self->{api_method} = $options->{method};
+ $self->{api_args} = $options->{args};
+ $self->{rest_uri} = $options->{rest_uri} || 'http://www.flickr.com/services/rest/';
+
bless $self, $class;
$self->method('POST');
- $self->uri('http://www.flickr.com/services/rest/');
+ $self->uri($self->{rest_uri});
return $self;
}
Modified: branches/upstream/libflickr-api-perl/current/test.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libflickr-api-perl/current/test.pl?rev=25969&op=diff
==============================================================================
--- branches/upstream/libflickr-api-perl/current/test.pl (original)
+++ branches/upstream/libflickr-api-perl/current/test.pl Sun Oct 12 17:19:20 2008
@@ -21,10 +21,12 @@
# check we get the 'method not found' error
#
-# this error code will change in future!
-is($rsp->{error_code}, 112, 'checking the error code for "method not found"');
-
-#print "code was $rsp->{error_code}, msg was $rsp->{error_message}\n";
+if ($rsp->{_rc} eq '200'){
+ # this error code may change in future!
+ is($rsp->{error_code}, 112, 'checking the error code for "method not found"');
+}else{
+ is(1, 1, "skipping error code check, since we couldn't reach the API");
+}
##################################################
@@ -33,7 +35,12 @@
#
$rsp = $api->execute_method('flickr.test.echo', {format => 'fake'});
-is($rsp->{error_code}, 111, 'checking the error code for "format not found"');
+
+if ($rsp->{_rc} eq '200'){
+ is($rsp->{error_code}, 111, 'checking the error code for "format not found"');
+}else{
+ is(1, 1, "skipping error code check, since we couldn't reach the API");
+}
##################################################
@@ -70,8 +77,8 @@
is($expect{$item}, $got{$item}, "Checking that the $item item in the query matches in reverse");
}
-ok($uri->path eq '/services/auth', "Checking correct return path");
-ok($uri->host eq 'flickr.com', "Checking return domain");
+ok($uri->path eq '/services/auth/', "Checking correct return path");
+ok($uri->host eq 'www.flickr.com', "Checking return domain");
ok($uri->scheme eq 'http', "Checking return protocol");
More information about the Pkg-perl-cvs-commits
mailing list