App/Chart/Suffix/OL.pm untested

filter: Statementstmt 0.0% 0 / 45 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 11 Podpod n/a totaltotal 0.0% 0 / 56 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 # Oslo Stock Exchange setups.
2  
3 # Copyright 2005, 2006, 2007, 2008, 2009, 2010 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 OLRTICULAR 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::OL;
20 use 5.006;
21 use strict;
22 use warnings;
23 use URI::Escape;
24 use Locale::TextDomain 'App-Chart';
25  
26 use App::Chart::Glib::Ex::MoreUtils;
27 use App::Chart;
28 use App::Chart::Sympred;
29 use App::Chart::TZ;
30 use App::Chart::Weblink;
31 use App::Chart::Yahoo;
32  
33  
34 our $timezone_oslo = App::Chart::TZ->new
35 (name => __('Oslo'),
36 choose => [ 'Europe/Oslo' ],
37 fallback => 'CET-1');
38  
39 # Indexes:
40 # ^OSEAX
41 my $pred_indexes = App::Chart::Sympred::Prefix->new ('^OS');
42  
43 my $pred_shares = App::Chart::Sympred::Suffix->new ('.OL');
44  
45 my $pred_any = App::Chart::Sympred::Any->new ($pred_indexes, $pred_shares);
46 $timezone_oslo->setup_for_symbol ($pred_any);
47  
48  
49 #------------------------------------------------------------------------------
50 # weblink - Oslo Bors company info
51 #
52 # Eg. Norwegian
53 #
54 # http://www.oslobors.no/ob/aksje_selskapsinfo?languageID=0&p_instrid=ticker.ose.PLUG&p_period=1D&menu2show=1.1.2.4.
55 #
56 # and English
57 #
58 # http://www.oslobors.no/ob/aksje_selskapsinfo?languageID=1&p_instrid=ticker.ose.PLUG&p_period=1D&menu2show=1.1.2.4.
59 #
60  
61 App::Chart::Weblink->new
62 (pred => $pred_shares,
63 name => __('Oslo Bors _Company Information'),
64 desc => __('Open web browser at the Oslo Stock Exchange page for this company'),
65 proc => sub {
66 my ($symbol) = @_;
67 $symbol = URI::Escape::uri_escape(App::Chart::symbol_sans_suffix($symbol));
68 my $lang = App::Chart::Glib::Ex::MoreUtils::lang_select (no => 0,
69 en => 1);
70 return "http://www.oslobors.no/ob/aksje_selskapsinfo?languageID=$lang&p_instrid=ticker.ose.$symbol&p_period=1D&menu2show=1.1.2.4.";
71 });
72  
73 1;
74 __END__