Created
May 22, 2021 16:45
-
-
Save sironekotoro/48b19672992331bf04eee4edfa43ae9b to your computer and use it in GitHub Desktop.
AWS Lambda Sample(https)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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