| App-Hachero documentation | Contained in the App-Hachero distribution. |
App::Hachero::Plugin::Classify::UserAgent - sets useragent information for the request
---
plugins:
- module: Classify::UserAgent
sets useragent information for the request.
Takaaki Mizuno <cpan@takaaki.info>
Nobuo Danjou <nobuo.danjou@gmail.com>
| App-Hachero documentation | Contained in the App-Hachero distribution. |
package App::Hachero::Plugin::Classify::UserAgent; use strict; use warnings; use base qw(App::Hachero::Plugin::Base); use HTTP::DetectUserAgent; sub init { my ($self, $context) = @_; } sub classify : Hook { my ($self, $context, $args) = @_; my $ua = $context->currentlog->{ua} or return; my $browser = HTTP::DetectUserAgent->new($ua); $context->currentinfo->{useragent} = $browser; } 1; __END__