• Dynamic DNS js

    From Mindless Automaton@VERT/ELDRITCH to DOVE-Net.Programming_(Javascript) on Wed Mar 28 18:11:18 2012
    I am using dtdns.com for dynamic dns. Usually my IP changed maybe 2
    times a year, so I didnt really worry about an updater. This month
    though the IP has changed like 3 times so I figured I would hack one up
    in js.

    All you have to do is: Get("http://www.dtdns.com/api/autodns.cfm?id=eldritch.darktech.org&pw=password&client=dtdns.js");

    However I am not really sure how to check the current IP vs the IP
    dtdns.com has.

    Any tips?

    Thanks!

    Mindless Automaton
    ---
    þ Synchronet þ Eldritch Clockwork BBS - eldritch.darktech.org
  • From Mindless Automaton@VERT/ELDRITCH to Mindless Automaton on Thu Apr 5 15:25:07 2012
    On 03/28/2012 11:11 AM, Mindless Automaton wrote:
    I am using dtdns.com for dynamic dns. Usually my IP changed maybe 2

    Okay, so I hacked up wget.js to get something like this:


    load("http.js");

    var url = argv[0];
    var filename=js.startup_dir + '/' + file_getname(url);

    var file = new File(filename);

    if(!file.open("w"))
    print("error " + file.error + " opening " + file.name);
    else {
    var contents = new HTTPRequest().Get("http://www.dtdns.com/api/autodns.cfm?id=eldritch.darktech.org&pw=password&client=dtdns.js");
    file.write(contents);
    file.close();
    }
    </js>

    I know I dont need the file stuff for this, but the changes I have tried
    have all failed.

    Any tips for tidying this up?

    Thanks!

    Mindless Automaton
    ---
    þ Synchronet þ Eldritch Clockwork BBS - eldritch.darktech.org
  • From Digital Man@VERT to Mindless Automaton on Thu Apr 5 23:17:30 2012
    Re: Re: Dynamic DNS js
    By: Mindless Automaton to Mindless Automaton on Thu Apr 05 2012 08:25 am

    On 03/28/2012 11:11 AM, Mindless Automaton wrote:
    I am using dtdns.com for dynamic dns. Usually my IP changed maybe 2

    Okay, so I hacked up wget.js to get something like this:


    load("http.js");

    var url = argv[0];
    var filename=js.startup_dir + '/' + file_getname(url);

    var file = new File(filename);

    if(!file.open("w"))
    print("error " + file.error + " opening " + file.name);
    else {
    var contents = new HTTPRequest().Get("http://www.dtdns.com/api/autodns.cfm?id=eldritch.darktech .org&pw=password&client=dtdns.js");
    file.write(contents);
    file.close();
    }
    </js>

    I know I dont need the file stuff for this, but the changes I have tried have all failed.

    Any tips for tidying this up?

    I'm not sure what you're trying to do. If you just need the HTTP-GET, then you should be able to remove all lines except the load() and HTTPRequest() lines.

    digital man

    Synchronet "Real Fact" #59:
    Free dynamic yourbbs.synchro.net hostnames were made first available in 2003. Norco, CA WX: 64.5øF, 54.0% humidity, 9 mph WSW wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Mindless Automaton@VERT/ELDRITCH to Digital Man on Mon Apr 9 16:24:55 2012
    On 04/05/2012 07:17 PM, Digital Man wrote:
    Re: Re: Dynamic DNS js
    By: Mindless Automaton to Mindless Automaton on Thu Apr 05 2012 08:25 am

    > On 03/28/2012 11:11 AM, Mindless Automaton wrote:
    > > I am using dtdns.com for dynamic dns. Usually my IP changed maybe 2

    >
    > Any tips for tidying this up?

    I'm not sure what you're trying to do. If you just need the HTTP-GET, then you
    should be able to remove all lines except the load() and HTTPRequest() lines.

    digital man

    Obviously I'm not sure what I'm doing either. :)

    Hmm.. I thought I had tried using those two lines and it wasnt working,
    but since it does now, I must have screwed something up previously.

    Thanks!

    Mindless Automaton
    ---
    þ Synchronet þ Eldritch Clockwork BBS - eldritch.darktech.org