App-Chart
view release on metacpan or search on metacpan
"Gtk2::Ex::WidgetBits" : "10",
"Gtk2::Ex::WidgetCursor" : "8",
"Gtk2::Ex::WidgetEvents" : "21",
"Gtk2::Pango" : "0",
"HTML::Form" : "0",
"HTML::LinkExtor" : "0",
"HTML::TableExtract" : "0",
"HTML::TreeBuilder" : "0",
"HTTP::Cookies" : "0",
"HTTP::Message" : "5.814",
"HTTP::Request" : "0",
"IO::String" : "1.07",
"JSON" : "0",
"LWP" : "5.814",
"LWP::UserAgent" : "0",
"Lisp::Printer" : "0",
"Lisp::Reader" : "0.04",
"Lisp::Symbol" : "0",
"List::MoreUtils" : "0.24",
"Locale::Messages" : "1.19",
"Locale::TextDomain" : "1.19",
Gtk2::Ex::WidgetBits: '10'
Gtk2::Ex::WidgetCursor: '8'
Gtk2::Ex::WidgetEvents: '21'
Gtk2::Pango: '0'
HTML::Form: '0'
HTML::LinkExtor: '0'
HTML::TableExtract: '0'
HTML::TreeBuilder: '0'
HTTP::Cookies: '0'
HTTP::Message: '5.814'
HTTP::Request: '0'
IO::String: '1.07'
JSON: '0'
LWP: '5.814'
LWP::UserAgent: '0'
Lisp::Printer: '0'
Lisp::Reader: '0.04'
Lisp::Symbol: '0'
List::MoreUtils: '0.24'
Locale::Messages: '1.19'
Locale::TextDomain: '1.19'
Makefile.PL view on Meta::CPAN
# (Locale::Messages in 1.16 didn't declare a version, it was only in
# Locale::TextDomain until 1.17 or 1.18 or something)
'Locale::TextDomain' => '1.19',
'Locale::Messages' => '1.19',
'LWP' => '5.814', # version 5.814 for new HTTP::Message::decodable()
# parts of lwp used explicitly, some of which are separate now
'LWP::UserAgent' => 0,
'HTTP::Cookies' => 0,
'HTTP::Message' => '5.814',
'HTTP::Request' => 0,
'HTML::Form' => 0,
'Math::Round' => 0,
'Module::Find' => 0.06, # version 0.06 avoids duplicates
'Module::Util' => 0,
'Module::Pluggable' => 0,
# version 1.60 for fixups to initializing in locales like de_DE with "."
# as the monetary thousands sep
'Number::Format' => '1.60',
lib/App/Chart/Download.pm view on Meta::CPAN
### Download get(): $url
# URI object becomes string
$url = "$url";
my $ua = $options{'ua'} || do { require App::Chart::UserAgent;
App::Chart::UserAgent->instance };
$ua->cookie_jar ($options{'cookie_jar'}); # undef for none
### cookie_jar object: ($options{'cookie_jar'} // "").""
require HTTP::Request;
my $method = $options{'method'} || 'GET';
my @headers = (Referer => $options{'referer'});
my $data = $options{'data'};
if (defined $data) {
push @headers, 'Content-Type' => 'application/x-www-form-urlencoded';
}
my $req = HTTP::Request->new ($method, $url, \@headers, $data);
# possible override
if (my $user_agent = $options{'user_agent'}) {
$req->user_agent($user_agent);
}
my $etag = $options{'etag'};
my $lastmod = $options{'last_modified'};
if (my $key = $options{'url_tags_key'}) {
lib/App/Chart/IntradayHandler.pm view on Meta::CPAN
require App::Chart::UserAgent;
my $ua = App::Chart::UserAgent->instance;
if (exists $options{'cookie_jar'}) {
### IntradayHandler cookie_jar: $options{'cookie_jar'}->as_string
$ua->cookie_jar ($options{'cookie_jar'});
} else {
$ua->cookie_jar ({});
}
require HTTP::Request;
my @headers = (Referer => $options{'referer'});
my $req = HTTP::Request->new ('GET', $url, \@headers);
$ua->prepare_request ($req);
### IntradayHandler request: $req->as_string
my $resp = $ua->request
($req,
sub {
my ($chunk, $resp, $protobj) = @_;
$resp->add_content($chunk);
# if the message is deflate/gzip/etc compressed then decoded_content
misc/t-barchart.pl view on Meta::CPAN
my $h = App::Chart::Barchart::fiveday_parse ('CLZ16.NYM', $resp);
print Dumper ($h);
# App::Chart::Download::write_latest_group ($h);
exit 0;
}
{
my $req_url = 'http://www.barchart.com/chart.php?sym=CLZ10&style=technical&p=I&d=O&im=&sd=&ed=&size=M&log=0&t=BAR&v=2&g=1&evnt=1&late=1&o1=&o2=&o3=&x=41&y=11&indicators=&addindicator=&submitted=1&fpage=&txtDate=#jump';
require HTTP::Request;
my $req = HTTP::Request->new ('GET', $req_url);
my $resp = HTTP::Response->new(200, 'OK');
$resp->request ($req);
my $content = slurp(<~/chart/samples/barchart/chart.php-daily.html>);
$resp->content($content);
$resp->content_type('application/x-javascript');
my $img_url = App::Chart::Barchart::intraday_resp_to_url ($resp, 'XYZ');
say $img_url;
exit 0;
}
{
my $url = 'http://www.barchart.com/detailedquote/futures/CLZ10';
require URI;
my $uri = URI->new($url);
require HTTP::Request;
my @headers = (Referer => $url);
my $req = HTTP::Request->new ('GET', $url, \@headers, undef);
print $req->uri,"\n";
require HTTP::Response;
my $resp = HTTP::Response->new
(200, 'OK',
[ 'Set-Cookie', 'bcad_int=1; path=/; domain=barchart.com;' ]);
$resp->request ($req);
print $resp->as_string,"\n";
require HTTP::Cookies;
misc/t-cas.pl view on Meta::CPAN
use strict;
use warnings;
use FindBin;
use File::Spec;
use Data::Dumper;
use File::Slurp 'slurp';
use App::Chart::Suffix::CAS;
{
require LWP;
my $req = HTTP::Request->new();
$req->uri('http://www.casablanca-bourse.com/fiches/valeurs/MNG/fr/ost.html');
my $resp = HTTP::Response->new();
$resp->request ($req);
my $content
= slurp ($ENV{'HOME'}.'/chart/samples/casab/ost-fr.html');
$resp->content($content);
$resp->{'_rc'} = 200;
my $h = App::Chart::Suffix::CAS::dividends_parse ('MNG.CAS', $resp);
print Dumper ($h);
misc/t-commsec.pl view on Meta::CPAN
print App::Chart::CommSec::is_enabled(),"\n";
exit 0;
}
{
print App::Chart::Download::Decode_Date_EU_to_iso ('080904'),"\n";
# print App::Chart::Download::Decode_Date_YMD_to_iso ('080904'),"\n";
exit 0;
}
{
my $req = HTTP::Request->new();
my $resp = HTTP::Response->new(200,'OK');
$resp->request ($req);
my $content = slurp (<~/chart/samples/commsec/ezychart-20080904.data>);
$resp->content($content);
my $h = App::Chart::CommSec::ezychart_parse ($resp);
# print Dumper ($h);
App::Chart::Download::write_daily_group ($h);
exit 0;
}
{
my $req = HTTP::Request->new();
my $resp = HTTP::Response->new(200,'OK');
$resp->request ($req);
my $content = slurp (<~/chart/samples/commsec/ezychart.data>);
$resp->content($content);
my $h = App::Chart::CommSec::ezychart_parse ($resp);
print Dumper ($h);
# App::Chart::Download::write_daily_group ($h);
exit 0;
}
{
my $req = HTTP::Request->new();
my $resp = HTTP::Response->new();
$resp->request ($req);
my $content = slurp ($ENV{'HOME'}.'/chart/samples/commsec/nabha.csv');
$resp->content($content);
$resp->{'_rc'} = 200;
my $h = App::Chart::CommSec::indiv_parse ($resp, 5*12);
print Dumper ($h);
# App::Chart::Download::write_daily_group ($h);
exit 0;
}
{
my $req = HTTP::Request->new();
my $resp = HTTP::Response->new();
$resp->request ($req);
my $content = slurp ($ENV{'HOME'}.'/chart/samples/commsec/etr-2mo.csv');
$resp->content($content);
$resp->{'_rc'} = 200;
my $h = App::Chart::CommSec::indiv_parse ($resp, 2);
print Dumper ($h);
# App::Chart::Download::write_daily_group ($h);
misc/t-lme.pl view on Meta::CPAN
{
require HTTP::Cookies;
my $jar = HTTP::Cookies->new;
my $ts = App::Chart::Suffix::LME::jar_get_login_timestamp($jar);
print Dumper($ts);
App::Chart::Suffix::LME::jar_set_login_timestamp($jar);
print "Jar as_string:\n",$jar->as_string;
require URI;
require HTTP::Request;
my $uri = URI->new;
$uri->scheme ('http');
$uri->host (App::Chart::Suffix::LME::LOGIN_DOMAIN());
$uri->path ('/');
my $req = HTTP::Request->new ('GET', $uri);
# $req->header ('Host', $uri->host);
my $ua = LWP::UserAgent->new;
$ua->prepare_request ($req);
$jar->add_cookie_header ($req);
print $req->as_string,"\n";
$jar->set_cookie (1, # version
'another', # key
'foo bar', # value
'/', # path
misc/t-nz.pl view on Meta::CPAN
# my $content = slurp ("$ENV{'HOME'}/chart/samples/nzx/Dividends.html");
# new sep 17
# my $content = slurp ("$ENV{HOME}/chart/samples/nzx/dividends-sep18.html");
# new sep 24
my $content = slurp ("$ENV{HOME}/chart/samples/nzx/dividends-sep24-json.html");
my $resp = HTTP::Response->new
(200, 'OK',
['Content-Type' => 'text/html; charset=utf-8'],
$content);
# my $req = HTTP::Request->new();
# $req->uri(App::Chart::Suffix::NZ->DIVIDENDS_URL);
# $resp->request ($req);
### charset: $resp->content_charset
# ### resp: $resp->as_string
$App::Chart::option{'verbose'} = 1;
my $h = App::Chart::Suffix::NZ::dividends_parse ($resp);
App::Chart::Download::crunch_h($h);
print Dumper ($h);
misc/t-useragent.pl view on Meta::CPAN
use strict;
use warnings;
use App::Chart::UserAgent;
use Data::Dumper;
print "Agent '",App::Chart::UserAgent->_agent,"'\n";
my $ua = App::Chart::UserAgent->instance;
{
# my $req = HTTP::Request->new (GET => 'http://localhost/bare2.html');
my $req = HTTP::Request->new (GET => 'http://localhost/x');
$ua->prepare_request ($req);
print $req->as_string;
my $resp = $ua->request ($req);
print $resp->as_string;
exit 0;
}
unused/t-tradingroom.pl view on Meta::CPAN
use strict;
use warnings;
use LWP;
use Data::Dumper;
use File::Slurp 'slurp';
use FindBin;
use lib::abs "$FindBin::Bin/lib";
use App::Chart::TradingRoom;
{
my $req = HTTP::Request->new();
my $resp = HTTP::Response->new(200,'OK');
$resp->request ($req);
my $content = slurp "$ENV{HOME}/chart/samples/tradingroom/pricehistory.ac?section=yearly_price_download&code=NABHA";
$resp->content($content);
my $h = App::Chart::TradingRoom::indiv_parse ($resp, 'NABHA.AX');
# print Dumper ($h);
App::Chart::Download::write_daily_group ($h);
exit 0;
}
( run in 0.689 second using v1.01-cache-2.11-cpan-de7293f3b23 )