• Dynamic DNS js

    From Mindless Automaton@ELDRITCH to DOVE-Net.Programming_(Javascript) on Wednesday, March 28, 2012 11:11:18
    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@ELDRITCH to Mindless Automaton on Thursday, April 05, 2012 08:25:07
    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 to Mindless Automaton on Thursday, April 05, 2012 16:17:30
    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
  • From Mindless Automaton@ELDRITCH to Digital Man on Monday, April 09, 2012 09:24:55
    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