Skip to content

Instantly share code, notes, and snippets.

@sironekotoro
sironekotoro / gist:d186da61f958d79d416f5b20075ec2a4
Created April 12, 2023 15:14
5ch のスレッド一覧を Web::Query で取得する
use strict;
use warnings;
use HTTP::Tiny;
use Encode qw/decode/;
use Web::Query;
my $temp = HTTP::Tiny->new->get('https://hayabusa9.5ch.net/news/');
my $str = decode('ShiftJIS' , $temp->{content} );
@sironekotoro
sironekotoro / wareki-seireki.pl
Last active March 19, 2022 16:31
サブルーチンの中身をif文の中に移して(正規表現を整理して)完成
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Encode qw/decode/;
my %era = (
慶応 => 1865,
明治 => 1868,
大正 => 1912,
#!/usr/bin/env perl
use strict;
use warnings;
use Win32::OLE;
# https://perldoc.jp/docs/modules/libwin32-0.26/Win32/OLE.pod
# use existing instance if Excel is already running
my $excel;
@sironekotoro
sironekotoro / discord_webhook.pl
Created December 2, 2021 05:19
Perl入学式用 Discord Webhook実習
#!/usr/bin/env perl
use strict;
use warnings;
use HTTP::Tiny;
use JSON::PP;
my $webhook_url = 'ここに貼り付ける';
my $options = {
@sironekotoro
sironekotoro / weather_report.pl
Last active December 2, 2021 05:15
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';
@sironekotoro
sironekotoro / tsconfig.json
Last active October 17, 2021 15:42
GAS用tsconfig.json
// GAS + clasp
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
@sironekotoro
sironekotoro / BankTransferFee.pl
Created June 26, 2021 15:25
PayPay銀行と三菱UFJ銀行の手数料計算例
#!/usr/bin/env perl
package Mufj;
use strict;
use warnings;
sub new {
my $class = shift;
my $self = bless { code => '0009' }, $class;
return $self;
}
@sironekotoro
sironekotoro / cpanfile
Created May 22, 2021 18:04
AWS Lambda Custom Layer
requires 'IO::Socket::SSL';
requires 'Net::SSLeay';
@sironekotoro
sironekotoro / hello.pl
Created May 22, 2021 16:45
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{
@sironekotoro
sironekotoro / hello.pl
Created May 22, 2021 16:31
AWS Lambda Sample(http)
#!/usr/bin/env perl
use strict;
use warnings;
use Encode qw/decode/;
use HTTP::Tiny;
my $url = 'http://abehiroshi.la.coocan.jp/';
my $ht = HTTP::Tiny->new();
sub handler{