Skip to content
Browse files

Update signature

  • Loading branch information...
1 parent 0bf578d commit 15b054a35598041c38450fa8bac1b019a1d83caf @Akron committed Feb 6, 2013
Showing with 11 additions and 8 deletions.
  1. +1 −1 Readme.pod
  2. +10 −7 lib/Mojolicious/Plugin/Piwik.pm
View
2 Readme.pod
@@ -206,7 +206,7 @@ L<Mojolicious>.
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2012-2013, Nils Diewald.
+Copyright (C) 2012-2013, L<Nils Diewald|http://nils-diewald.de/>.
This program is free software, you can redistribute it
and/or modify it under the same terms as Perl.
View
17 lib/Mojolicious/Plugin/Piwik.pm
@@ -3,10 +3,8 @@ use Mojo::Base 'Mojolicious::Plugin';
use Mojo::ByteStream 'b';
use Mojo::UserAgent;
-
our $VERSION = '0.09';
-
# Todo:
# - Add tracking API support
# See http://piwik.org/docs/javascript-tracking/
@@ -29,6 +27,7 @@ sub register {
$plugin_param = { %$config_param, %$plugin_param };
};
+ # Embed tag
my $embed = $plugin_param->{embed} //
($mojo->mode eq 'production' ? 1 : 0);
@@ -108,14 +107,18 @@ SCRIPTTAG
token_auth => $token_auth
);
- # Urls as array
+ # Urls
if ($param->{urls}) {
+
+ # Urls is arrayref
if (ref $param->{urls}) {
my $i = 0;
foreach (@{$param->{urls}}) {
- $url->query({'urls[' . $i++ . ']' => $_});
+ $url->query({ 'urls[' . $i++ . ']' => $_ });
};
}
+
+ # Urls as string
else {
$url->query({urls => $param->{urls}});
};
@@ -136,10 +139,10 @@ SCRIPTTAG
$date = ref $date ? join(',', @$date) : $date;
};
- if ($period =~ /^(?:day|week|month|year|range)$/) {
+ if ($period =~ m/^(?:day|week|month|year|range)$/) {
$url->query({
period => $period,
- date => $date
+ date => $date
});
};
};
@@ -391,7 +394,7 @@ L<Mojolicious>.
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2012-2013, Nils Diewald.
+Copyright (C) 2012-2013, L<Nils Diewald|http://nils-diewald.de/>.
This program is free software, you can redistribute it
and/or modify it under the same terms as Perl.

0 comments on commit 15b054a

Please sign in to comment.
Something went wrong with that request. Please try again.