1 2 3 4 5 6 7 8
use strict; use warnings; use Fcntl qw(:DEFAULT :flock); sub modulname { my ($eingangref,$ausgangref) = @_; ... } return '1';
1 2 3
require "verzeichnis/moduldateiname.pl"; my (%ausgabe,%rueckerhalt); modulname(\%ausgabe,\%rueckerhalt);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
#!/usr/bin/perl use strict; use warnings; my %req_json = ( date => '2021-03-24', time => ['00:00','06:00','12:00','18:00'], leadtime_hour => '0', area => [70, -18, 69, -17], # North, West, South, East type => 'analysis', variable => 'total_aerosol_optical_depth_670nm', format => 'netcdf_zip', ); require JSON; JSON->import('-support_by_pp'); my $req_json_string = JSON->new->latin1->escape_slash()->encode(\%req_json); require HTTP::Request; my $request = HTTP::Request->new(POST => 'https://ads.atmosphere.copernicus.eu/api/v2'); $request->header('content-type' => 'application/json'); $request->header('accept' => 'application/json'); $request->content('cams-global-atmospheric-composition-forecasts',$req_json_string,'download.netcdf_zip'); $request->authorization_basic('meine uid','mein api key'); require IO::Socket::SSL; IO::Socket::SSL->import(qw(SSL_VERIFY_NONE)); require LWP::UserAgent; my $ua = LWP::UserAgent->new( cookie_jar => {}, agent => 'Perl', timeout => 10, ssl_opts => { SSL_verify_mode => SSL_VERIFY_NONE(), verify_hostname => 0, } ) or do { die; }; my $response = $ua->request($request); if ($response->is_success) { my $content = $response->decoded_content; say $content; } else { die $response->status_line; }
Quote404 Not Found at cams_api_forum.pl line 42.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import cdsapi
c = cdsapi.Client()
c.retrieve(
'cams-global-atmospheric-composition-forecasts',
{
'date': '2021-03-24',
'time': [
'00:00', '06:00', '12:00',
'18:00',
],
'leadtime_hour': '0',
'area': [ #North, West, South, East
70, -18, 69,
-17,
],
'type':'analysis',
'variable': 'total_aerosol_optical_depth_670nm',
'format': 'netcdf_zip',
},
'download.netcdf_zip')
2023-04-08T08:43:52 biancaUnd noch eine Frage: falls ich dafür ein Modul schreibe, das ich auf CPAN veröffentlichen möchte, worauf muss ich von Anfang an achten?
2023-04-08T08:43:52 biancaund kenne auch bless noch nicht