Skip to content

Instantly share code, notes, and snippets.

@sorshi
Last active December 24, 2020 06:30
Show Gist options
  • Save sorshi/3917131 to your computer and use it in GitHub Desktop.
Save sorshi/3917131 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
#
# usage:
#http://www.dcc-jpl.com/diary/2012/08/18/fusion-smart-asterisk/
use LWP::Simple;
use utf8;
use Encode;
my $searchnumber = $ARGV[0];
if ($searchnumber eq ""){
print "NO";
exit;
}
if ($searchnumber =~ /^050/){
$searchnumber =~ s/\D//gi;
$searchnumber = substr($searchnumber,0,7);
#無料通話可能な050番号 | IP-Phone SMART https://ip-phone-smart.jp/smart/free050/
my @freelist = (
'0505210'
,'0505211'
,'0505212'
,'0505213'
,'0505214'
,'0505215'
,'0505216'
,'0505217'
,'0505218'
,'0505219'
,'0505220'
,'0505221'
,'0505222'
,'0505223'
,'0505224'
,'0505225'
,'0505226'
,'0505227'
,'0505228'
,'0505229'
,'0505230'
,'0505231'
,'0505232'
,'0505233'
,'0505234'
,'0505235'
,'0505236'
,'0505237'
,'0505238'
,'0505239'
,'0505240'
,'0505241'
,'0505242'
,'0505243'
,'0505244'
,'0505245'
,'0505246'
,'0505247'
,'0505248'
,'0505249'
,'0505250'
,'0505251'
,'0505252'
,'0505253'
,'0505254'
,'0505255'
,'0505256'
,'0505257'
,'0505258'
,'0505259'
,'0505260'
,'0505261'
,'0505262'
,'0505263'
,'0505264'
,'0505265'
,'0505266'
,'0505267'
,'0505268'
,'0505269'
,'0505270'
,'0505271'
,'0505272'
,'0505273'
,'0505274'
,'0505275'
,'0505276'
,'0505277'
,'0505278'
,'0505279'
,'0505280'
,'0505281'
,'0505282'
,'0505283'
,'0505284'
,'0505285'
,'0505286'
,'0505287'
,'0505288'
,'0505289'
,'0505290'
,'0505291'
,'0505292'
,'0505293'
,'0505294'
,'0505295'
,'0505296'
,'0505297'
,'0505298'
,'0505299'
,'0505300'
,'0505301'
,'0505302'
,'0505303'
,'0505304'
,'0505305'
,'0505306'
,'0505307'
,'0505308'
,'0505309'
,'0505310'
,'0505311'
,'0505312'
,'0505313'
,'0505314'
,'0505315'
,'0505316'
,'0505317'
,'0505318'
,'0505319'
,'0505320'
,'0505321'
,'0505322'
,'0505323'
,'0505324'
,'0505325'
,'0505326'
,'0505327'
,'0505328'
,'0505329'
,'0505330'
,'0505331'
,'0505332'
,'0505333'
,'0505334'
,'0505335'
,'0505336'
,'0505337'
,'0505338'
,'0505339'
,'0505340'
,'0505341'
,'0505342'
,'0505343'
,'0505344'
,'0505345'
,'0505346'
,'0505347'
,'0505348'
,'0505349'
,'0505350'
,'0505351'
,'0505352'
,'0505353'
,'0505354'
,'0505355'
,'0505356'
,'0505357'
,'0505358'
,'0505359'
,'0505360'
,'0505361'
,'0505362'
,'0505363'
,'0505364'
,'0505365'
,'0505366'
,'0505367'
,'0505368'
,'0505369'
,'0505370'
,'0505371'
,'0505372'
,'0505373'
,'0505374'
,'0505375'
,'0505376'
,'0505377'
,'0505378'
,'0505379'
,'0505380'
,'0505381'
,'0505382'
,'0505383'
,'0505384'
,'0505385'
,'0505386'
,'0505387'
,'0505388'
,'0505389'
,'0505390'
,'0505391'
,'0505392'
,'0505393'
,'0505394'
,'0505395'
,'0505396'
,'0505397'
,'0505398'
,'0505399'
,'0505400'
,'0505401'
,'0505402'
,'0505403'
,'0505404'
,'0505405'
,'0505406'
,'0505407'
,'0505408'
,'0505409'
,'0505410'
,'0505411'
,'0505412'
,'0505413'
,'0505414'
,'0505415'
,'0505416'
,'0505417'
,'0505418'
,'0505419'
,'0505420'
,'0505421'
,'0505422'
,'0505423'
,'0505424'
,'0505425'
,'0505426'
,'0505427'
,'0505428'
,'0505429'
,'0505430'
,'0505431'
,'0505432'
,'0505433'
,'0505434'
,'0505435'
,'0505436'
,'0505437'
,'0505438'
,'0505439'
,'0505440'
,'0505441'
,'0505442'
,'0505443'
,'0505444'
,'0505445'
,'0505446'
,'0505447'
,'0505448'
,'0505449'
,'0505450'
,'0505451'
,'0505452'
,'0505453'
,'0505454'
,'0505455'
,'0505456'
,'0505457'
,'0505458'
,'0505459'
,'0505460'
,'0505461'
,'0505462'
,'0505463'
,'0505464'
,'0505465'
,'0505466'
,'0505467'
,'0505468'
,'0505469'
,'0505470'
,'0505471'
,'0505472'
,'0505473'
,'0505474'
,'0505475'
,'0505476'
,'0505477'
,'0505478'
,'0505479'
,'0505480'
,'0505481'
,'0505482'
,'0505483'
,'0505484'
,'0505485'
,'0505486'
,'0505487'
,'0505488'
,'0505489'
,'0505490'
,'0505491'
,'0505492'
,'0505493'
,'0505494'
,'0505495'
,'0505496'
,'0505497'
,'0505498'
,'0505499'
,'0505500'
,'0505501'
,'0505502'
,'0505503'
,'0505504'
,'0505505'
,'0505506'
,'0505507'
,'0505508'
,'0505509'
,'0505510'
,'0505511'
,'0505512'
,'0505513'
,'0505514'
,'0505515'
,'0505516'
,'0505517'
,'0505518'
,'0505519'
,'0505520'
,'0505521'
,'0505522'
,'0505523'
,'0505524'
,'0505525'
,'0505526'
,'0505527'
,'0505528'
,'0505529'
,'0505530'
,'0505531'
,'0505532'
,'0505533'
,'0505534'
,'0505535'
,'0505536'
,'0505537'
,'0505538'
,'0505539'
,'0505570'
,'0505571'
,'0505572'
,'0505573'
,'0505574'
,'0505575'
,'0505576'
,'0505577'
,'0505578'
,'0505579'
,'0505580'
,'0505581'
,'0505582'
,'0505583'
,'0505584'
,'0505585'
,'0505586'
,'0505587'
,'0505588'
,'0505589'
,'0505590'
,'0505591'
,'0505592'
,'0505593'
,'0505594'
,'0505595'
,'0505596'
,'0505597'
,'0505598'
,'0505599'
,'0505600'
,'0505601'
,'0505602'
,'0505603'
,'0505604'
,'0505605'
,'0505606'
,'0505607'
,'0505608'
,'0505609'
,'0505777'
,'0505778'
,'0505779'
,'0505780'
,'0505781'
,'0505782'
,'0505783'
,'0505784'
,'0505785'
,'0505786'
,'0505787'
,'0505788'
,'0505789'
,'0505790'
,'0505791'
,'0505792'
,'0505793'
,'0505794'
,'0505795'
,'0505796'
,'0505797'
,'0505798'
,'0505799'
,'0505800'
,'0505801'
,'0505802'
,'0505803'
,'0505804'
,'0505805'
,'0505806'
,'0505807'
,'0505808'
,'0505809'
,'0505810'
,'0505811'
,'0505812'
,'0505813'
,'0505814'
,'0505815'
,'0505816'
,'0505817'
,'0505818'
,'0505819'
,'0505820'
,'0505821'
,'0505822'
,'0505823'
,'0505824'
,'0505825'
,'0505826'
,'0505827'
,'0505828'
,'0505829'
,'0505830'
,'0505831'
,'0505832'
,'0505833'
,'0505834'
,'0505835'
,'0505836'
,'0505837'
,'0505838'
,'0505839'
,'0505840'
,'0505841'
,'0505842'
,'0505843'
,'0505844'
,'0505845'
,'0505846'
,'0505847'
,'0505848'
,'0505849'
,'0505850'
,'0505851'
,'0505852'
,'0505853'
,'0505854'
,'0505855'
,'0505856'
,'0505857'
,'0505858'
,'0505859'
,'0505860'
,'0505861'
,'0505862'
,'0505863'
,'0505864'
,'0505865'
,'0505866'
,'0505867'
,'0505868'
,'0505869'
,'0505870'
,'0505871'
,'0505872'
,'0505873'
,'0505874'
,'0505875'
,'0505876'
,'0505877'
,'0505878'
,'0505879'
,'0505880'
,'0505881'
,'0505882'
,'0505883'
,'0505884'
,'0505885'
,'0505886'
,'0505887'
,'0505888'
,'0505889'
,'0505890'
,'0505891'
,'0505892'
,'0505893'
,'0505894'
,'0505895'
,'0505896'
,'0505897'
,'0505898'
,'0505899'
,'0508000'
,'0508001'
,'0508002'
,'0508003'
,'0508004'
,'0508005'
,'0508006'
,'0508007'
,'0508009'
,'0508010'
,'0508011'
,'0508012'
,'0508013'
,'0508014'
,'0508016'
,'0508019'
,'0508020'
,'0508021'
,'0508022'
,'0508026'
,'0508027'
,'0508030'
,'0508031'
,'0508034'
,'0508035'
,'0508036'
,'0508037'
,'0508038'
,'0507788'
,'0507770'
,'0507771'
,'0507772'
,'0507773'
,'0507774'
,'0507775'
,'0507776'
,'0507777'
,'0507778'
,'0507779'
,'0507100'
,'0507101'
,'0507102'
,'0507103'
,'0507104'
,'0507105'
,'0507106'
,'0507107'
,'0507108'
,'0507109'
,'0507110'
,'0507111'
,'0507112'
,'0507113'
,'0507114'
,'0507115'
,'0507116'
,'0507117'
,'0507118'
,'0507119'
,'0507120'
,'0507121'
,'0507122'
,'0507123'
,'0507124'
,'0507125'
,'0507126'
,'0507127'
,'0507128'
,'0507129'
,'0507130'
,'0507131'
,'0507132'
,'0507133'
,'0507134'
,'0507135'
,'0507136'
,'0508800'
,'0508801'
,'0508802'
,'0508803'
,'0508804'
,'0508805'
,'0508806'
,'0508807'
,'0508808'
,'0508809'
,'0508810'
,'0508200'
,'0508201'
,'0508202'
,'0508203'
,'0508208'
,'0508215'
,'0508217'
,'0508218'
,'0508223'
,'0508224'
,'0508225'
,'0508228'
,'0508229'
,'0508232'
,'0508233'
,'0506619'
,'0506620'
,'0506621'
,'0506622'
);
my @freenumber = grep(/$searchnumber/,@freelist);
if ( scalar(@freenumber) >= 1){
print "FREE";
exit;
}else{
print "NO";
exit;
}
}else{
print "NO";
exit;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment