Skip to content

Instantly share code, notes, and snippets.

@sironekotoro
Last active December 2, 2021 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sironekotoro/09954632ea3c79f899139e808bbda2ca to your computer and use it in GitHub Desktop.
Save sironekotoro/09954632ea3c79f899139e808bbda2ca to your computer and use it in GitHub Desktop.
Perl入学式用 気象庁非公式API
#!/usr/bin/env perl
use strict;
use warnings;
use HTTP::Tiny;
use JSON::PP; # 追加
my $url
= 'https://www.jma.go.jp/bosai/forecast/data/overview_forecast/130000.json';
my $response = HTTP::Tiny->new()->get($url);
my $content = $response->{content};
my $decoded_content = JSON::PP->new->decode($content); #追加
print $decoded_content->{targetArea}; #追加
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment