#! /usr/local/bin/perl -w use strict; use GD::Graph::mixed; use GD::Graph::colour qw( :files ); use GD::Text; use LWP::Simple; use Jcode; ## 札幌は47412 室蘭は47423 my @areas = qw(47412 47423); GD::Graph::colour::read_rgb( "/usr/X11R6/lib/X11/rgb.txt" ) or die( "Can't read colours" ); my @xLabels = qw( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 ); my @temper = (); my @humidity = (); while ( @temper < 24 ) { push @temper,undef; } while ( @humidity < 24 ) { push @humidity, undef; } my @data = ( \@xLabels, \@humidity, \@temper ); ## HTMLを頂いて、プロットする値を入れます。 my $weather_news_base = 'http://www.data.kishou.go.jp/maiji/data/'; foreach my $area (@areas) { my $graph = GD::Graph::mixed->new( 400, 300 ); $graph->set(# title => "Atomspheric temperature 2004/7/27", y1_label => "percent", y2_label => "degree", x_label => "hour", types => [ qw(lines lines) ], dclrs => [ qw(DarkGreen orange1) ], # long_ticks => 1, x_label_skip => 2, line_width => 2, two_axes => 1, # y2_max_value => 35, # y2_min_value => 15, # legend_placement => "RT", ); $graph->set_legend ("humidity", "temperature" ); my $fullurl = $weather_news_base . $area . '.html'; print STDERR "getting:$fullurl\n"; my $text = get ( $fullurl ); $text = jcode($text)->euc; foreach ( split/\n/, $text ) { chomp; ## せっかくだから日付も教えます if ( /