App/Chart/Suffix/HK.pm untested

filter: Statementstmt 0.0% 0 / 34 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod n/a totaltotal 0.0% 0 / 42 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 # Hong Kong Stock Exchange (HKEX) setups.
2  
3 # Copyright 2005, 2006, 2007, 2008, 2009 Kevin Ryde
4  
5 # This file is part of Chart.
6 #
7 # Chart is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 3, or (at your option) any later version.
10 #
11 # Chart is distributed in the hope that it will be useful, but WITHOUT ANY
12 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14 # details.
15 #
16 # You should have received a copy of the GNU General Public License along
17 # with Chart. If not, see <http://www.gnu.org/licenses/>.
18  
19 package App::Chart::Suffix::HK;
20 use strict;
21 use warnings;
22 use Locale::TextDomain 'App-Chart';
23  
24 use App::Chart;
25 use App::Chart::Sympred;
26 use App::Chart::TZ;
27 use App::Chart::Weblink;
28 use App::Chart::Yahoo;
29  
30 my $timezone_hongkong = App::Chart::TZ->new
31 (name => __('Hong Kong'),
32 choose => [ 'Asia/Hong_Kong' ],
33 fallback => 'HKT-8');
34  
35 my $pred_shares = App::Chart::Sympred::Suffix->new ('.HK');
36  
37 # ^HSI hang seng index
38 my $pred_indexes = App::Chart::Sympred::Prefix->new ('^H');
39  
40 my $pred_any = App::Chart::Sympred::Any->new ($pred_indexes, $pred_shares);
41 $timezone_hongkong->setup_for_symbol ($pred_any);
42  
43  
44 #------------------------------------------------------------------------------
45 # weblink - company info
46 #
47  
48 App::Chart::Weblink->new
49 (pred => $pred_shares,
50 name => __('HKEX _Company Information'),
51 desc => __('Open web browser at the Hong Kong Stock Exchange page for this company'),
52 proc => sub {
53 my ($symbol) = @_;
54 # extra "0" in the ID for the web page over what Yahoo uses
55 return 'http://www.hkex.com.hk/invest/index.asp?id=company/profile_page_e.asp?WidCoID=0'
56 . URI::Escape::uri_escape (App::Chart::symbol_sans_suffix ($symbol))
57 . '&WidCoAbbName=&Month=&langcode=e';
58 });
59  
60 1;
61 __END__