If this saves you money then I'm happy.
so drumroll..... here you are (whois.py is my project name for the file)
import socket
tld = 'whois.verisign-grs.com'
def whois(domain):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((tld, 43))
str = domain+'\n'
s.send(str.encode())
buffer = ''
while True:
data = s.recv(1024).decode()
if data:
buffer += data
else:
break
return buffer
def available(domain):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((tld, 43))
str = domain+'\n'
s.send(str.encode())
buffer = ''
data = s.recv(1024).decode()
if "No match for" in data:
return True
return FalseAlso, I have another project for which I store a huge amount of data, and as it turns out, data costs a lot of money to store! Depends on the size of the list, I might be better off paying for the Domainr API.
367000000 * 253 bytes = 92.8GB
As you only need to know the domain exists.In reality it would be smaller than that as the average length will be much shorted. I expect 10-20GB
You could get clever and use a bloom filter to save space, falling back to the api.
Here is my current setup: "max_tokens" => 150, "temperature" => 0.6, "top_p" => 1, "frequency_penalty" => 1, "presence_penalty" => 1,
model is text-davinci-003.
Can you let me know how you are only charged $10 for 40K requests?
That's amazing. Hope they can continue to keep the pricing that low.