Skip to content

Commit 244db2c

Browse files
committed
Chore: Apply format
1 parent 5f0df38 commit 244db2c

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Scripts/Create-WhoisServerListFromWebAndWhois.ps1

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,16 @@ $RootNode = $Document.CreateNode("element", "WhoisServers", $null)
2222

2323
$ProgressCount = 0
2424

25-
foreach($Tld in $IANA_TLDs)
26-
{
27-
if($Tld.StartsWith("#"))
28-
{
25+
foreach ($Tld in $IANA_TLDs) {
26+
if ($Tld.StartsWith("#")) {
2927
continue
3028
}
3129

3230
$currentTld = $Tld.Trim()
3331

3432
$tcpClient = New-Object System.Net.Sockets.TcpClient("whois.iana.org", 43)
3533

36-
$networkStream= $tcpClient.GetStream()
34+
$networkStream = $tcpClient.GetStream()
3735

3836
$bufferedStream = New-Object System.IO.BufferedStream($networkStream)
3937

@@ -46,8 +44,7 @@ foreach($Tld in $IANA_TLDs)
4644

4745
$stringBuilder = New-Object System.Text.StringBuilder
4846

49-
while(!$streamReader.EndOfStream)
50-
{
47+
while (!$streamReader.EndOfStream) {
5148
$stringBuilder.Append($streamReader.ReadLine())
5249
}
5350

@@ -66,7 +63,10 @@ foreach($Tld in $IANA_TLDs)
6663
[void]$RootNode.AppendChild($WhoisServerNode)
6764

6865
Write-Host -Object "Progress: $ProgressCount from $($IANA_TLDs.Count)"
69-
$ProgressCount ++
66+
$ProgressCount++
67+
68+
# Sleep 1 because there is a rate limit
69+
Start-Sleep -Seconds 1
7070
}
7171

7272
[void]$Document.AppendChild($RootNode)

0 commit comments

Comments
 (0)