| 1 | # Bombay Stock Exchange (BSE) setups. | ||
| 2 | |||
| 3 | # Copyright 2005, 2006, 2007, 2008, 2009, 2014 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::BO; | ||
| 20 | use strict; | ||
| 21 | use warnings; | ||
| 22 | use URI::Escape; | ||
| 23 | use Locale::TextDomain 'App-Chart'; | ||
| 24 | |||
| 25 | use App::Chart; | ||
| 26 | use App::Chart::Sympred; | ||
| 27 | use App::Chart::TZ; | ||
| 28 | use App::Chart::Weblink; | ||
| 29 | use App::Chart::Yahoo; | ||
| 30 | |||
| 31 | |||
| 32 | my $timezone_bombay = App::Chart::TZ->new | ||
| 33 | (name => __('Bombay'), | ||
| 34 | # or calcutta as no separate entry for Bombay in the Olson database | ||
| 35 | choose => [ 'Asia/Bombay', 'Asia/Calcutta', 'Asia/Kolkata' ], | ||
| 36 | fallback => 'IST-5:30'); | ||
| 37 | |||
| 38 | # ^BSESN bse sensitive | ||
| 39 | my $pred_indexes = App::Chart::Sympred::Prefix->new ('^BSE'); | ||
| 40 | my $pred_shares = App::Chart::Sympred::Suffix->new ('.BO'); | ||
| 41 | |||
| 42 | my $pred_any = App::Chart::Sympred::Any->new ($pred_indexes, $pred_shares); | ||
| 43 | $timezone_bombay->setup_for_symbol ($pred_any); | ||
| 44 | |||
| 45 | |||
| 46 | #------------------------------------------------------------------------------ | ||
| 47 | # weblink - BSE company info | ||
| 48 | # | ||
| 49 | # Eg. http://www.bseindia.com/qresann/comp_info.asp?scrip_cd=532401 | ||
| 50 | # | ||
| 51 | |||
| 52 | App::Chart::Weblink->new | ||
| 53 | (pred => $pred_shares, | ||
| 54 | name => __('BSE _Company Information'), | ||
| 55 | desc => __('Open web browser at the Bombay Stock Exchange page for this company'), | ||
| 56 | proc => sub { | ||
| 57 | my ($symbol) = @_; | ||
| 58 | # there's links on this page to results, announcements, quote, etc | ||
| 59 | return 'http://www.bseindia.com/qresann/comp_info.asp?scrip_cd=' | ||
| 60 | . URI::Escape::uri_escape (App::Chart::symbol_sans_suffix ($symbol)); | ||
| 61 | }); | ||
| 62 | |||
| 63 | 1; | ||
| 64 | __END__ |