line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
Flower - passive agent |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 VERSION |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Version 0.10 |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 SYNOPSIS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
start up your elasticsearch |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sudo /etc/init.d/elasticsearch start |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
now ready to go ahead |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
git clone https://github.com/santex/Flower.git; |
19
|
|
|
|
|
|
|
cd Flower; |
20
|
|
|
|
|
|
|
dzil build; |
21
|
|
|
|
|
|
|
dzil test; |
22
|
|
|
|
|
|
|
sudo dzil install; |
23
|
|
|
|
|
|
|
pwd=$(pwd); |
24
|
|
|
|
|
|
|
ip=127.0.0.1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
perl $pwd"/bin/flower" --ip $ip --filepath $pwd"/data/" |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
Then visit L in your browser. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
test urls passive log |
31
|
|
|
|
|
|
|
L |
32
|
|
|
|
|
|
|
L |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
package Flower; |
38
|
|
|
|
|
|
|
|
39
|
2
|
|
|
2
|
|
1235
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
51
|
|
40
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
60
|
|
41
|
|
|
|
|
|
|
|
42
|
2
|
|
|
2
|
|
9
|
use Mojo::Base 'Mojolicious'; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
19
|
|
43
|
2
|
|
|
2
|
|
225047
|
use Data::Printer; |
|
2
|
|
|
|
|
71985
|
|
|
2
|
|
|
|
|
17
|
|
44
|
2
|
|
|
2
|
|
279
|
use Mojo::Server::Daemon; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
42
|
|
45
|
2
|
|
|
2
|
|
48
|
use EV; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
44
|
|
46
|
2
|
|
|
2
|
|
3144
|
use AnyEvent; |
|
2
|
|
|
|
|
11882
|
|
|
2
|
|
|
|
|
65
|
|
47
|
2
|
|
|
2
|
|
1457
|
use Data::UUID; |
|
2
|
|
|
|
|
1644
|
|
|
2
|
|
|
|
|
137
|
|
48
|
2
|
|
|
2
|
|
1559
|
use Mojolicious::Plugin::SimpleSession; |
|
2
|
|
|
|
|
16611
|
|
|
2
|
|
|
|
|
25
|
|
49
|
|
|
|
|
|
|
# This method will run once at server start |
50
|
|
|
|
|
|
|
sub startup { |
51
|
2
|
|
|
2
|
1
|
32133
|
my $self = shift; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# Routes |
54
|
2
|
|
|
|
|
9
|
my $r = $self->routes; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# Normal route to controller |
57
|
2
|
|
|
|
|
33
|
$r->route('/')->to('interface#root',set=>{}); |
58
|
2
|
|
|
|
|
350
|
$r->route('/about')->to('interface#root',set=>{}); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
2
|
|
|
|
|
441
|
$r->route('/q/:type')->to('rest#query'); |
62
|
|
|
|
|
|
|
#$r->route('/q/:type')->to('rest#query'); |
63
|
|
|
|
|
|
|
# RESTful routes |
64
|
|
|
|
|
|
|
# routes for the remote nodes to hit |
65
|
|
|
|
|
|
|
#$r->route('/REST/1.0/:file')->to('upload#store'); |
66
|
2
|
|
|
|
|
421
|
$r->route('/REST/1.0/ping')->via(qw/POST/)->to('rest#ping'); |
67
|
2
|
|
|
|
|
534
|
$r->route('/REST/1.0/files')->to('rest#file_get_by_uuid'); |
68
|
2
|
|
|
|
|
520
|
$r->route('/REST/1.0/file/:uuid')->to('rest#files'); |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# routes for the local interface to use |
71
|
|
|
|
|
|
|
# XXX should check it is the local user! |
72
|
2
|
|
|
|
|
555
|
$r->route('/REST/1.0/files/all')->to('rest#files_all'); |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |
80
|
|
|
|
|
|
|
# ABSTRACT: your passive agent arround the web |
81
|
|
|
|
|
|
|
=head1 AUTHOR |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Hagen Geissler, C<< >> |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Copyright 2015 Hagen Geissler |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
90
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
91
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=cut |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
1; |