Skip to content

Instantly share code, notes, and snippets.

@sironekotoro
Created May 22, 2021 16:45
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/48b19672992331bf04eee4edfa43ae9b to your computer and use it in GitHub Desktop.
Save sironekotoro/48b19672992331bf04eee4edfa43ae9b to your computer and use it in GitHub Desktop.
AWS Lambda Sample(https)
#!/usr/bin/env perl
use strict;
use warnings;
use HTTP::Tiny;
my $url = 'https://www.yahoo.co.jp/';
my $ht = HTTP::Tiny->new();
sub handler{
my $res = $ht->get($url);
$res->{content} =~ /<title>(?<title>.+?)<\/title>/;
return {
status => $res->{status},
title => $+{title},
}
}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment