Subj : syncWXremix and Dial-up To : Digital Man From : KenDB3 Date : Wed Jan 06 2016 10:23 pm DM> Re: Re: Sync Weather App - syncWXremix DM> By: KenDB3 to tbirdsradio on Fri Jan 01 2016 08:11 am >> Re: Re: Sync Weather App - syncWXremix >> By: tbirdsradio to KenDB3 on Thu Dec 31 2015 09:34 am > tb>> Once again i got ahead of myself. Dial up user phoned in and > tb>> received this error: > tb>> "Error in weather.js api.underground.com returned a > tb>> 'querynotfound' error with this description. 'No cities match your search query'." > tb>> Do i have the above right? >> That's all correct. I just didn't account for dial-up users. Mainly >> because I don't have any dial-up access, it didn't really dawn on me. >> Can anyone shed some light on how I might test for this scenario? I'm >> guessing the user's IP comes up as undefined in this case? DM> Assuming the BBS is using SEXPOTS, the user's IP address should be the IP DM> address of the BBS computer, or possibly 127.0.0.1 (I forget which). You DM> can programatically detect a SEXPOTS/dial-up connection by checking if DM> user.connection is a number (e.g. "28800") rather than a protocol string DM> (e.g. "Telnet"). DM> Something like this: DM> var dialup = (parseInt(user.connection) > 0); DM> At least, I think would work (without actually trying it). Let me know how DM> it works for you, DM, I was hoping you might be able to help point me in the right direction on this. tbirdsradio had a chance to try out the new version from GitHub that used this bit of code (but had no luck): var dialup = (parseInt(user.connection) > 0); function getQuerySuffix() { var qs; if (dialup === 'true') { if (fallback_type == 'nonip') { qs = fallback + '.json'; } else { qs = 'autoip.json?geo_ip=' + resolve_ip(system.inet_addr); } } else if (user.ip_address.search( /(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1] \.)|(^169\.254\.)|(^::1$)|(^[fF][cCdD])/ ) > -1 ) { if (fallback_type == 'nonip') { qs = fallback + '.json'; } else { if (client.protocol === 'Telnet') { qs = wstsGetIPAddress(); } else if (bbs.sys_status&SS_RLOGIN) { qs = wsrsGetIPAddress(); } if (typeof qs === 'undefined') qs = resolve_ip(system.inet_addr); qs = 'autoip.json?geo_ip=' + qs; } } else { qs = 'autoip.json?geo_ip=' + user.ip_address; } return qs; } var wungrndQuery = getQuerySuffix(); ********** However, tbird is still seeing an error when the app is launched at Logon and also as a Door/External for his dial-up user. DEBUG for weather.js API call looked like this at the time of error: http://api.wunderground.com/api/XXXXXXXXXXXXXXXX/conditions/forecast/astronomy/ alerts/q/autoip.json?geo_ip=812XXXXXXX (Blocked out API and last 7 of phone number). Any thoughts as to why I am missing catching this scenario? It's got me boggled and I can't really see it. Thanks for any help you can lend (and sorry for the long post). ~KenDB3 --- þ Synchronet þ KD3net-Rhode Island's only BBS about nothing. http://bbs.kd3.us .