line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finance::QuoteTW; |
2
|
1
|
|
|
1
|
|
31421
|
use Spiffy -Base; |
|
1
|
|
|
|
|
8801
|
|
|
1
|
|
|
|
|
10
|
|
3
|
1
|
|
|
1
|
|
5222
|
use Carp; |
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
41
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
34
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
76
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
#--------------------------------------------------------------------------- |
6
|
|
|
|
|
|
|
# Variables |
7
|
|
|
|
|
|
|
#--------------------------------------------------------------------------- |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
1017
|
use version; our $VERSION = qv('0.09'); |
|
1
|
|
|
|
|
2750
|
|
|
1
|
|
|
|
|
8
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my @onshore = qw/capital iit jpmrich tisc paradigm allianz/; |
12
|
|
|
|
|
|
|
my @offshore = qw/jpmrich franklin schroders blackrock/; |
13
|
|
|
|
|
|
|
my @all = ( @onshore, @offshore ); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#--------------------------------------------------------------------------- |
16
|
|
|
|
|
|
|
# Methods |
17
|
|
|
|
|
|
|
#--------------------------------------------------------------------------- |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new() { |
20
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
21
|
0
|
|
|
|
|
|
my %args = @_; |
22
|
0
|
|
0
|
|
|
|
$args{encoding} ||= 'big5'; |
23
|
0
|
|
|
|
|
|
return bless \%args, $class; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
0
|
1
|
|
sub names { |
27
|
0
|
|
0
|
|
|
|
my $type = shift || q{}; |
28
|
0
|
0
|
|
|
|
|
return $type eq 'onshore' ? @onshore |
|
|
0
|
|
|
|
|
|
29
|
|
|
|
|
|
|
: $type eq 'offshore' ? @offshore |
30
|
|
|
|
|
|
|
: @all; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
0
|
1
|
|
sub fetch { |
34
|
0
|
|
|
|
|
|
my %args = @_; |
35
|
0
|
0
|
|
|
|
|
my @all = |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
36
|
|
|
|
|
|
|
$args{site} =~ /capital/ixm ? $self->_capital(%args) |
37
|
|
|
|
|
|
|
: $args{site} =~ /iit/ixm ? $self->_iit(%args) |
38
|
|
|
|
|
|
|
: $args{site} =~ /jpmrich/ixm ? $self->_jpmrich(%args) |
39
|
|
|
|
|
|
|
: $args{site} =~ /tisc/ixm ? $self->_tisc(%args) |
40
|
|
|
|
|
|
|
: $args{site} =~ /franklin/ixm ? $self->_franklin(%args) |
41
|
|
|
|
|
|
|
: $args{site} =~ /schroders/ixm ? $self->_schroders(%args) |
42
|
|
|
|
|
|
|
: $args{site} =~ /blackrock/ixm ? $self->_blackrock(%args) |
43
|
|
|
|
|
|
|
: $args{site} =~ /paradigm/ixm ? $self->_paradigm(%args) |
44
|
|
|
|
|
|
|
: $args{site} =~ /allianz/ixm ? $self->_allianz(%args) |
45
|
|
|
|
|
|
|
: croak "Invalid site: $args{site}\n"; |
46
|
|
|
|
|
|
|
|
47
|
0
|
0
|
|
|
|
|
my @result = $args{name} ? grep { $_->{name} =~ $args{name} } @all : @all; |
|
0
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
|
return wantarray ? @result : \@result; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
0
|
1
|
|
sub fetch_all { |
52
|
0
|
|
0
|
|
|
|
my $type = shift || q{}; |
53
|
0
|
0
|
|
|
|
|
my @array = |
|
|
0
|
|
|
|
|
|
54
|
|
|
|
|
|
|
$type eq 'onshore' ? @onshore |
55
|
|
|
|
|
|
|
: $type eq 'offshore' ? @offshore |
56
|
|
|
|
|
|
|
: @all; |
57
|
0
|
|
|
|
|
|
my %result = |
58
|
0
|
|
|
|
|
|
map { $_ => [ $self->fetch( site => $_, type => $type ) ] } @array; |
59
|
0
|
0
|
|
|
|
|
return wantarray ? %result : \%result; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
0
|
|
|
sub _allianz { |
63
|
0
|
|
|
|
|
|
require Finance::QuoteTW::Allianz; |
64
|
0
|
|
|
|
|
|
return Finance::QuoteTW::Allianz::fetch( $self, @_ ); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
0
|
|
|
sub _paradigm { |
68
|
0
|
|
|
|
|
|
require Finance::QuoteTW::Paradigm; |
69
|
0
|
|
|
|
|
|
return Finance::QuoteTW::Paradigm::fetch( $self, @_ ); |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
0
|
|
|
0
|
|
|
sub _capital { |
73
|
0
|
|
|
|
|
|
require Finance::QuoteTW::Capital; |
74
|
0
|
|
|
|
|
|
return Finance::QuoteTW::Capital::fetch( $self, @_ ); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
0
|
|
|
sub _iit { |
78
|
0
|
|
|
|
|
|
require Finance::QuoteTW::Iit; |
79
|
0
|
|
|
|
|
|
return Finance::QuoteTW::Iit::fetch( $self, @_ ); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
0
|
|
|
0
|
|
|
sub _jpmrich { |
83
|
0
|
|
|
|
|
|
require Finance::QuoteTW::Jpmrich; |
84
|
0
|
|
|
|
|
|
return Finance::QuoteTW::Jpmrich::fetch( $self, @_ ); |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
0
|
|
|
0
|
|
|
sub _tisc { |
88
|
0
|
|
|
|
|
|
require Finance::QuoteTW::Tisc; |
89
|
0
|
|
|
|
|
|
return Finance::QuoteTW::Tisc::fetch( $self, @_ ); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
0
|
|
|
0
|
|
|
sub _franklin { |
93
|
0
|
|
|
|
|
|
require Finance::QuoteTW::Franklin; |
94
|
0
|
|
|
|
|
|
return Finance::QuoteTW::Franklin::fetch( $self, @_ ); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
0
|
|
|
0
|
|
|
sub _schroders { |
98
|
0
|
|
|
|
|
|
require Finance::QuoteTW::Schroders; |
99
|
0
|
|
|
|
|
|
return Finance::QuoteTW::Schroders::fetch( $self, @_ ); |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
0
|
|
|
0
|
|
|
sub _blackrock { |
103
|
0
|
|
|
|
|
|
require Finance::QuoteTW::Blackrock; |
104
|
0
|
|
|
|
|
|
return Finance::QuoteTW::Blackrock::fetch( $self, @_ ); |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
__END__ |