-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
31 lines (24 loc) · 854 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from SOAPpy import WSDL, Errors
import ConfigParser
OVH_WSDL_URL = 'http://www.ovh.com/soapi/soapi-re-latest.wsdl'
def main():
config = ConfigParser.ConfigParser()
config.read('config.ini')
login = config.get('ovh', 'login')
password = config.get('ovh', 'password')
domains = []
with open("domains", "r") as f:
domains = f.read().splitlines()
client = WSDL.Proxy(OVH_WSDL_URL)
try:
session = client.login(login, password)
for domain in domains:
result = client.domainCheck(session, domain)
for info in result['item']:
if info['predicate'] == 'is_available':
if info['value'] is True:
print('Domain %s is available' % domain)
except Errors.Error, e:
print(e)
if __name__ == '__main__':
main()