PDA

View Full Version : Request for freedns


misterhh
2008-07-13, 22:08
I have a dynamic DNS account with afraid.org, and was wondering if someone could whip up a simple script that goes to a URL every 5 minutes or so. The site has a URL set up that will automatically assign your domain to the IP that accessed the URL.

blittan
2008-07-13, 23:41
post the url and I will whip it up ;)

misterhh
2008-07-13, 23:46
http://freedns.afraid.org/dynamic/update.php?<ID>

blittan
2008-07-14, 00:38
Here you go, just replace <add_your_id_here> with the letters and numbers after the ?


import xbmc, urllib2

theID = '<add_your_id_here>'

# no need to change stuff under here..
theURL = 'http://freedns.afraid.org/dynamic/update.php?'+str(theID)
user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
headers = { 'User-Agent' : user_agent }
try:
response = urllib2.urlopen(theURL)
html = response.read()
xbmc.executebuiltin('xbmc.Notification(FreeDNS,' + html +')')
except:
xbmc.executebuiltin('XBMC.Notification(FreeDNS, Update failed)')


hopefully this works (tested on my xbox) didn't work in linux

paste this into a file and save it in the scripts folder of xbmc

misterhh
2008-07-14, 00:44
Alright, thank you. Also, how do I make it start automatically with xbmc?

blittan
2008-07-14, 01:04
save it as autoexec.py in your scripts folder.. but it only runs once every boot.
don't think the ip would change that often, better to run it manually

Nuka1195
2008-07-14, 04:00
now whip up that installer :P