本帖最后由 zaqmlp 于 2019-8-10 11:38 编辑
- @echo off
- set info=互助互利,支付宝扫码头像,感谢赞助
- rem 有问题,可加QQ956535081及时沟通
- title %info%
- cd /d "%~dp0"
- set "txtfile1=域名列表.txt"
- set "txtfile2=结果.txt"
- set "appcode=你申请的appcode码"
- :input
- set "ym="
- if not exist "%txtfile1%" (
- set /p ym=输入域名:
- if not defined ym (goto input)
- )
- powershell -NoProfile -ExecutionPolicy bypass ^
- [System.Collections.ArrayList]$list=@();^
- [System.Collections.ArrayList]$s=@();^
- if('%ym%' -ne ''){[void]$list.add('%ym%');};^
- if(test-path -liter '%txtfile1%'){^
- $list=[IO.File]::ReadAllLines('%txtfile1%',[Text.Encoding]::Default);^
- };^
- $url='http://ali-beian.showapi.com/beian?domain=';^
- $web=New-Object System.Net.WebClient;^
- $web.Encoding=[System.Text.Encoding]::UTF8;^
- $web.Headers.Add('Authorization','APPCODE %appcode%');^
- for($i=0;$i -lt $list.count;$i++){^
- $str=$web.DownloadString($url+$list[$i]);^
- $m=[regex]::match($str,'\"num\":\"([^^\""]+)\"');^
- if($m.success){^
- write-host ($list[$i]+' --^>'+$m.groups[0].value);^
- [void]$s.add($list[$i]);^
- }else{write-host ($list[$i]+' --^> 无记录');};^
- };^
- [IO.File]::WriteAllLines('%txtfile2%', $s, [Text.Encoding]::Default);
- echo;%info%
- pause
复制代码
|