モジュール名
Google 電卓用のモジュールを作った。
http://svn.unknownplace.org/public/library/perl/trunk/WWW-GoogleCalc/
なんか名前がむずかしい。
CPAN みると google 関係だけで
- Net::Google::*
- WWW::Google::*
- WebService::Google::*
とかありまくるし。どれつかえばええねん。
こういう、無理矢理ハック系のは WWW かなとおもったので WWW::GoogleCalc としたのだけど、どうなんだろう。
PlaggerLDR
rating 対応。
YAML.pm bug?
use strict; use warnings;
use Data::Dumper;
use YAML;
my $config = {
default => [ 1, { '*' => 1 }, ],
deny => ['script'],
};
my $yaml = Dump($config);
print $yaml;
print Dumper( Load($yaml) );
output:
---
default:
- 1
- '*': 1
deny:
- script
YAML Error: Couldn't parse single line value
Code: YAML_PARSE_ERR_SINGLE_LINE
Line: 5
Document: 1
at /usr/local/share/perl/5.8.7/YAML.pm line 60
This code works fine with YAML::Syck
.
Hachathon in CL
中。
なんか
PlaggerLDR 改造
簡易認証追加と server.pl -d
のときだけデバッグモードになるように
Index: lib/PlaggerLDR/Controller/API.pm
===================================================================
--- lib/PlaggerLDR/Controller/API.pm (revision 1819)
+++ lib/PlaggerLDR/Controller/API.pm (working copy)
@@ -12,8 +12,9 @@
my $module = first { $_->{module} eq 'Store::DBIC' } @{$config->{plugins}};
my $schema = Plagger::Schema::SQLite->connect(@{$module->{config}->{connect_info}});
-sub default : Private {
+sub auto : Private {
my($self, $c) = @_;
+ $c->user;
}
sub subs : Local {
Index: lib/PlaggerLDR.pm
===================================================================
--- lib/PlaggerLDR.pm (revision 1819)
+++ lib/PlaggerLDR.pm (working copy)
@@ -3,21 +3,45 @@
use strict;
use warnings;
-use Catalyst qw/-Debug/;
+use Catalyst qw(
+ Authentication
+ Authentication::Credential::Password
+ Authentication::Store::Minimal
+ Session
+ Session::State::Cookie
+ Session::Store::FastMmap
+);
+
__PACKAGE__->config(
name => 'PlaggerLDR',
'View::JSON' => {
expose_stash => 'json',
},
+ authentication => {
+ users => {
+ your_username => { password => 'your_password', },
+ },
+ },
);
__PACKAGE__->setup;
sub default : Private {
my ( $self, $c ) = @_;
- # Hello World
- $c->response->body( $c->welcome_message );
+ $c->login(
+ $c->req->params->{u},
+ $c->req->params->{p},
+ );
+
+ $c->res->status(404);
}
1;