line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package POE::Component::Omegle; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
8431
|
use 5.006000; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
32
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
2188
|
use POE; |
|
1
|
|
|
|
|
76887
|
|
|
1
|
|
|
|
|
7
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
13
|
0
|
|
|
|
|
|
my @args = @_; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
my $self = { |
16
|
|
|
|
|
|
|
session => POE::Session->create( |
17
|
|
|
|
|
|
|
package_states => [ |
18
|
|
|
|
|
|
|
OMSession => [qw/_start _stop start_chat say disconnect set_callback |
19
|
|
|
|
|
|
|
on_event_handled poke/], |
20
|
|
|
|
|
|
|
], |
21
|
|
|
|
|
|
|
args => \@args, |
22
|
|
|
|
|
|
|
), |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
bless $self, $class; |
26
|
0
|
|
|
|
|
|
return $self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub AUTOLOAD { |
30
|
0
|
|
|
0
|
|
|
my $self = shift; |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
1
|
|
101847
|
use vars qw($AUTOLOAD); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
99
|
|
33
|
0
|
|
|
|
|
|
my $state = $AUTOLOAD; |
34
|
0
|
|
|
|
|
|
$state =~ s/.*:://; |
35
|
0
|
|
|
|
|
|
$poe_kernel->post( $self->{session} => $state => @_ ); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
##### |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
package OMSession; |
42
|
|
|
|
|
|
|
|
43
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
44
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
45
|
|
|
|
|
|
|
|
46
|
1
|
|
|
1
|
|
4
|
use POE; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
47
|
1
|
|
|
1
|
|
1167
|
use WWW::Omegle; |
|
1
|
|
|
|
|
306857
|
|
|
1
|
|
|
|
|
496
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub _start { |
51
|
0
|
|
|
0
|
|
|
my ($kernel, $sender, $heap, $session, %args) = @_[KERNEL, SENDER, HEAP, SESSION, ARG0..$#_]; |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
my $om = $heap->{om} = new WWW::Omegle(); |
54
|
0
|
|
|
|
|
|
$kernel->yield(set_callback => 'event_handled', $session->postback('on_event_handled')); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub set_callback { |
58
|
0
|
|
|
0
|
|
|
my ($sender, $heap, $callback, $state, @extra) = @_[SENDER, HEAP, ARG0, ARG1, ARG2..$#_]; |
59
|
0
|
|
|
|
|
|
$heap->{om}->set_callback($callback => $sender->postback($state), @extra); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
0
|
|
|
sub _stop {} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# initiate a convo |
65
|
|
|
|
|
|
|
sub start_chat { |
66
|
0
|
|
|
0
|
|
|
my ($kernel, $sender, $heap, $pb) = @_[KERNEL, SENDER, HEAP, ARG0]; |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
$heap->{om}->start; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub poke { |
72
|
0
|
|
|
0
|
|
|
my ($kernel, $sender, $heap) = @_[KERNEL, SENDER, HEAP]; |
73
|
0
|
|
|
|
|
|
$heap->{om}->poke; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub on_event_handled { |
77
|
0
|
|
|
0
|
|
|
my ($sender, $heap, $success) = @_[SENDER, HEAP, ARG0]; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub say { |
81
|
0
|
|
|
0
|
|
|
my ($sender, $heap, $msg) = @_[SENDER, HEAP, ARG0]; |
82
|
0
|
|
|
|
|
|
$heap->{om}->say($msg); |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub disconnect { |
86
|
0
|
|
|
0
|
|
|
my ($sender, $heap) = @_[SENDER, HEAP]; |
87
|
0
|
|
|
|
|
|
$heap->{om}->disconnect; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
1; |
91
|
|
|
|
|
|
|
__END__ |