| 1 | package App::SocialSKK::Plugin::SocialIME; | ||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use URI; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 1 | ▶ | use URI::QueryParam; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 1 | ▶ | use base qw(App::SocialSKK::Plugin); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 0 | ▶ | sub get_candidates { | ||||||||||||||||||
|
Subroutine
get_candidates: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||
| 9 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 10 | 0 | ▶ | return if ($text || '') eq ''; | ||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$text || ''
MC/DC0%0/1
$text || ''
$text
Truth table0%0/2
A
A= $text
| |||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 0 | my $uri = URI->new('http://www.social-ime.com/api/'); | |||||||||||||||||||
| 13 | 0 | $uri->query_param(string => $text); | |||||||||||||||||||
| 14 | 0 | my $res = $self->ua->get($uri); | |||||||||||||||||||
| 15 | 0 | ▶ | if ($res->is_success) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 16 | 0 | map { s|\s*$||smg; $_ } grep { $_ !~ /^\s*$/ } split /\t/, $res->content; | |||||||||||||||||||
| 17 | } | ||||||||||||||||||||
| 18 | } | ||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | 1 | 1; | |||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | __END__ | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | =head1 NAME | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | App::SocialSKK::Plugin::SocialIME - Retrieves Candidates from Social | ||||||||||||||||||||
| 27 | IME | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | =head1 SYNOPSIS | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | # Add a line like below into your .socialskk: | ||||||||||||||||||||
| 32 | plugins: | ||||||||||||||||||||
| 33 | - name: SocialIME | ||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | =head1 DESCRIPTION | ||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | App::SocialSKK::Plugin::SocialIME performs retrieval of candidates | ||||||||||||||||||||
| 38 | from Social IME. This plugin will be used by default in socialskk.pl | ||||||||||||||||||||
| 39 | without any configuration in .socialskk. | ||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | =head1 SEE ALSO | ||||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | =over 4 | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | =item * Social IME | ||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | http://www.social-ime.com/ | ||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | =back | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | =head1 AUTHOR | ||||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | Kentaro Kuribayashi E<lt>kentaro@cpan.orgE<gt> | ||||||||||||||||||||