- # -*- coding: utf-8 -*-
- import calendar
- import sys
- import time
- import xmlrpclib
- import socket
- username = 'XXXX@loopiaapi'
- password = 'XXXX'
- domain = 'XXXX'
- subdomain = 'XXXX'
- s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
- s.connect(('ipv6.google.com', 0))
- IP6 = s.getsockname()
- global_domain_server_url = 'https://api.loopia.se/RPCSERV'
- client = xmlrpclib.ServerProxy(uri = global_domain_server_url, encoding = 'utf-8')
- myrecords = client.getZoneRecords(username, password, domain, subdomain)
- for myrecord in myrecords:
- if myrecord['type'] == 'AAAA' and myrecord['rdata'] != IP6:
- myrecord['rdata'] = IP6
- client.updateZoneRecord(username, password, domain, subdomain, myrecord)
- print myrecord
a guest Feb 11th, 2010 126 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
RAW Paste Data