line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Kwiki::SOAP::Fortune; |
2
|
1
|
|
|
1
|
|
27304
|
use Kwiki::SOAP '-Base'; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use mixin 'Kwiki::Installer'; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# XXX at least some of this should come from preferences |
6
|
|
|
|
|
|
|
const wsdl => 'http://www.asleep.net/soap/services.php?wsdl'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = 0.01; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
const class_title => 'fortune soap retrieval'; |
11
|
|
|
|
|
|
|
const class_id => 'fortunesoap'; |
12
|
|
|
|
|
|
|
const css_file => 'fortunesoap.css'; |
13
|
|
|
|
|
|
|
const method => 'fortune'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub register { |
16
|
|
|
|
|
|
|
my $registry = shift; |
17
|
|
|
|
|
|
|
$registry->add(template => 'fortune_soap.html'); |
18
|
|
|
|
|
|
|
$registry->add(wafl => fortunesoap => 'Kwiki::SOAP::Fortune::Wafl'); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub get_result { |
22
|
|
|
|
|
|
|
my $type = shift; |
23
|
|
|
|
|
|
|
$self->soap( |
24
|
|
|
|
|
|
|
$self->wsdl, |
25
|
|
|
|
|
|
|
$self->method, |
26
|
|
|
|
|
|
|
[$type] |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
package Kwiki::SOAP::Fortune::Wafl; |
31
|
|
|
|
|
|
|
use base 'Kwiki::SOAP::Wafl'; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub html { |
34
|
|
|
|
|
|
|
my ($type) = split(' ', $self->arguments); |
35
|
|
|
|
|
|
|
my $result = $self->hub->fortunesoap->get_result($type); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
$self->hub->template->process('fortune_soap.html', |
38
|
|
|
|
|
|
|
fortune => $result, |
39
|
|
|
|
|
|
|
soap_class => $self->hub->fortunesoap->class_id, |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
package Kwiki::SOAP::Fortune; |
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__DATA__ |