line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Hubot::Scripts::ascii; |
2
|
|
|
|
|
|
|
$Hubot::Scripts::ascii::VERSION = '0.2.7'; |
3
|
1
|
|
|
1
|
|
1389
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
293
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub load { |
7
|
0
|
|
|
0
|
0
|
|
my ( $class, $robot ) = @_; |
8
|
|
|
|
|
|
|
$robot->hear( |
9
|
|
|
|
|
|
|
qr/^ascii:?( me)? (.+)/i, |
10
|
|
|
|
|
|
|
sub { |
11
|
0
|
|
|
0
|
|
|
my $msg = shift; |
12
|
|
|
|
|
|
|
$msg->http('http://asciime.heroku.com/generate_ascii') |
13
|
|
|
|
|
|
|
->query( 's', $msg->match->[1] )->get( |
14
|
|
|
|
|
|
|
sub { |
15
|
0
|
|
|
|
|
|
my ( $body, $hdr ) = @_; |
16
|
0
|
0
|
0
|
|
|
|
return if ( !$body || !$hdr->{Status} =~ /^2/ ); |
17
|
0
|
|
|
|
|
|
$msg->send( split( /\n/, $body ) ); |
18
|
|
|
|
|
|
|
} |
19
|
0
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
} |
21
|
0
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=pod |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=encoding utf-8 |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 NAME |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Hubot::Scripts::ascii |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 VERSION |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
version 0.2.7 |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 SYNOPSIS |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
ascii me <text> - Show text in ascii art |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 AUTHOR |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Hyungsuk Hong <hshong@perl.kr> |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
This software is copyright (c) 2012 by Hyungsuk Hong. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
51
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |