Created
June 10, 2016 14:42
-
-
Save vgaicuks/77d5c162f4823be77999b7c468a4d3b7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Create domains.txt file with domains list WITHOUT .lv seperated by newlines | |
# example: | |
# trialine | |
import requests | |
f = open('domains.txt') | |
for domain in f: | |
payload = { | |
"domain": domain | |
} | |
r = requests.post('https://www.nic.lv/domain/check/?lang=en', data=payload) | |
if r.ok: | |
if r.content.find('already exists') > 0: | |
print '{}.lv already exists'.format(domain.rstrip()) | |
else: | |
print '{}.lv is available'.format(domain.rstrip()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment