r20733 - in /branches/upstream/libnet-akismet-perl/current: Changes META.yml README lib/Net/Akismet.pm

yvesago-guest at users.alioth.debian.org yvesago-guest at users.alioth.debian.org
Fri Jun 6 07:04:47 UTC 2008


Author: yvesago-guest
Date: Fri Jun  6 07:04:44 2008
New Revision: 20733

URL: http://svn.debian.org/wsvn/?sc=1&rev=20733
Log:
[svn-upgrade] Integrating new upstream version, libnet-akismet-perl (0.05)

Modified:
    branches/upstream/libnet-akismet-perl/current/Changes
    branches/upstream/libnet-akismet-perl/current/META.yml
    branches/upstream/libnet-akismet-perl/current/README
    branches/upstream/libnet-akismet-perl/current/lib/Net/Akismet.pm

Modified: branches/upstream/libnet-akismet-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-akismet-perl/current/Changes?rev=20733&op=diff
==============================================================================
--- branches/upstream/libnet-akismet-perl/current/Changes (original)
+++ branches/upstream/libnet-akismet-perl/current/Changes Fri Jun  6 07:04:44 2008
@@ -1,4 +1,11 @@
 Revision history for Perl extension Net::Akismet.
+
+0.05
+	- mention in the docs about the host/version feature
+
+0.04  Thu Jun  5 19:58:41 EEST 2008
+	- allow service host and version to be changed from the constructor
+	- SYNOPSIS fixes by John Belmonte	
 
 0.03  Mon Aug 27 10:28:28 EEST 2007
 	- proper user agent handling, patch by John Belmonte, rt bug #28939
@@ -11,4 +18,4 @@
 	- original version; created by h2xs 1.23 with options
 		-AX --skip-exporter --use-new-tests -n Net::Akismet
 
-$Id: Changes 33 2007-08-27 07:30:07Z humperdink $
+$Id: Changes 38 2008-06-05 17:15:12Z humperdink $

Modified: branches/upstream/libnet-akismet-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-akismet-perl/current/META.yml?rev=20733&op=diff
==============================================================================
--- branches/upstream/libnet-akismet-perl/current/META.yml (original)
+++ branches/upstream/libnet-akismet-perl/current/META.yml Fri Jun  6 07:04:44 2008
@@ -1,11 +1,11 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Net-Akismet
-version:      0.03
+version:      0.05
 version_from: lib/Net/Akismet.pm
 installdirs:  site
 requires:
     LWP:                           5.09
 
 distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30_01
+generated_by: ExtUtils::MakeMaker version 6.30

Modified: branches/upstream/libnet-akismet-perl/current/README
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-akismet-perl/current/README?rev=20733&op=diff
==============================================================================
--- branches/upstream/libnet-akismet-perl/current/README (original)
+++ branches/upstream/libnet-akismet-perl/current/README Fri Jun  6 07:04:44 2008
@@ -1,4 +1,4 @@
-Net-Akismet version 0.01
+Net-Akismet version 0.05
 ========================
 
 Net::Akismet is meant to provide perl interface to the Akismet web service.
@@ -32,4 +32,4 @@
 it under the same terms as Perl itself, either Perl version 5.8.7 or,
 at your option, any later version of Perl 5 you may have available.
 
-$Id: README 15 2006-01-11 13:31:47Z humperdink $
+$Id: README 38 2008-06-05 17:15:12Z humperdink $

Modified: branches/upstream/libnet-akismet-perl/current/lib/Net/Akismet.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-akismet-perl/current/lib/Net/Akismet.pm?rev=20733&op=diff
==============================================================================
--- branches/upstream/libnet-akismet-perl/current/lib/Net/Akismet.pm (original)
+++ branches/upstream/libnet-akismet-perl/current/lib/Net/Akismet.pm Fri Jun  6 07:04:44 2008
@@ -14,7 +14,7 @@
 use LWP::UserAgent;
 use HTTP::Request::Common;
 
-our $VERSION	= '0.03';
+our $VERSION	= '0.05';
 
 my $UA_SUFFIX	= "Perl-Net-Akismet/$VERSION";
 
@@ -26,11 +26,11 @@
 		) or die('Key verification failure!');
 
 	my $verdict = $akismet->check(
-			USER_IP 		=> '10.10.10.11',
-			USER_AGENT 		=> 'Mozilla/5.0',
+			USER_IP 			=> '10.10.10.11',
+			COMMENT_USER_AGENT 	=> 'Mozilla/5.0',
 			COMMENT_CONTENT		=> 'Run, Lola, Run, the spam will catch you!',
 			COMMENT_AUTHOR		=> 'dosser',
-			COMENT_AUTHOR_EMAIL	=> 'dosser at subway.de',
+			COMMENT_AUTHOR_EMAIL	=> 'dosser at subway.de',
 			REFERRER		=> 'http://lola.home/',
 		) or die('Is the server here?');
 
@@ -66,6 +66,14 @@
 	your-killer-app/0.042 Perl-Net-Akismet/0.01 libwww-perl/5.8
 
 Otherwise just Akismet Perl's user agent string will be sent.
+
+=item	SERVICE_HOST
+
+If supplied, the host of the service API. The default is rest.akismet.com
+
+=item	SERVICE_VERSION
+
+If supplied, the API version. The default is 1.1
 
 =back
 
@@ -91,6 +99,9 @@
 	$agent = "$params{USER_AGENT} $agent" if $params{USER_AGENT};
 	$self->{ua}->agent($agent);
 
+	$self->{SERVICE_HOST} = $params{SERVICE_HOST} || 'rest.akismet.com';
+	$self->{SERVICE_VERSION} = $params{SERVICE_VERSION} || '1.1';
+
 	bless $self, $class;
 
 	return $self->_verify_key()? $self : undef;
@@ -100,9 +111,8 @@
 
 	my $self 	= shift;
 
-
 	my $response = $self->{ua}->request(
-			POST 'http://rest.akismet.com/1.1/verify-key', 
+			POST "http://$self->{SERVICE_HOST}/$self->{SERVICE_VERSION}/verify-key", 
 			[
 				key		=> $self->{KEY},
 				blog 	=> $self->{URL},
@@ -216,8 +226,11 @@
 
 	$comment->{USER_IP} && $comment->{COMMENT_USER_AGENT} || return undef;
 
+	# accomodate common misspelling
+	$comment->{REFERRER} = $comment->{REFERER} if !$comment->{REFERRER} && $comment->{REFERER};
+
 	my $response = $self->{ua}->request(
-    	POST "http://$self->{KEY}.rest.akismet.com/1.1/$action",
+    	POST "http://$self->{KEY}.$self->{SERVICE_HOST}/$self->{SERVICE_VERSION}/$action",
             [
                 blog 					=> $self->{URL},
 				user_ip					=> $comment->{USER_IP},
@@ -259,7 +272,7 @@
 
 =head1 AUTHOR
 
-Nikolay Bachiyski E<lt>nbachiyski at developer.bgE<gt>
+Nikolay Bachiyski E<lt>nb at nikolay.bgE<gt>
 
 =head2 Help, modifications and bugfixes from:
 
@@ -273,10 +286,10 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2006, 2007 by Nikolay Bachiyski
+Copyright (C) 2006, 2007, 2008 by Nikolay Bachiyski
 
 This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.
 
-$Id: Akismet.pm 32 2007-08-27 07:21:34Z humperdink $
-
-=cut
+$Id: Akismet.pm 38 2008-06-05 17:15:12Z humperdink $
+
+=cut




More information about the Pkg-perl-cvs-commits mailing list