Skip to content

Instantly share code, notes, and snippets.

@vgaicuks
Created June 10, 2016 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vgaicuks/77d5c162f4823be77999b7c468a4d3b7 to your computer and use it in GitHub Desktop.
Save vgaicuks/77d5c162f4823be77999b7c468a4d3b7 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
# Create domains.txt file with domains list WITHOUT .lv seperated by newlines
# example:
# trialine
# google
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