Skip to content

Commit

Permalink
Fix the click registration to store more data.
Browse files Browse the repository at this point in the history
Start to support the admin pages.
  • Loading branch information
davorg committed Apr 8, 2012
1 parent a374ebb commit 0270578
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Shrtr/lib/Shrtr.pm
Expand Up @@ -10,6 +10,10 @@ get '/' => sub {
template 'index';
};

get '/register' => sub {
template 'register';
};

get qr{ /(\w+)\+ }x => sub {
my ($code) = splat;

Expand All @@ -25,7 +29,12 @@ get qr{ /(\w+) }x => sub {
my ($code) = splat;

if (my $url = $url_rs->find({code => $code})) {
$url->add_to_clicks({});
my $req = request;
$url->add_to_clicks({
user_agent => $req->user_agent,
referrer => $req->referer,
ip_address => $req->remote_address,
});
template 'frame', {
url => $url,
}, {
Expand Down

0 comments on commit 0270578

Please sign in to comment.