Hey there folks,
A while back (May/June '15) I posted about a cool terminal app called Wego that gave you text based weather forecast info.
DM said it would be cool if someone made one for Sync, and nolageek had posted that he had started such a project and put it on GitHub.
Well, I decided to work on nola's script (syncWX) and create some new icons based on the Wego set of icons, and finally I came out with a finished product I call syncWXremix.
Here's some links:
http://bbs.kd3.us/kd3doors.ssjs
https://github.com/KenDB3/syncWXremix
Feel free to have a look and if you are adventurous maybe even set it up.
opts=load({},"modopts.js","SyncWX");
var wungrndAPIkey = opts.wungrndAPIkey;
Well, I decided to work on nola's script (syncWX) and create some new
icons based on the Wego set of icons, and finally I came out with a
finished product I call syncWXremix.
Here's some links:
http://bbs.kd3.us/kd3doors.ssjs
https://github.com/KenDB3/syncWXremix
Feel free to have a look and if you are adventurous maybe even set it
up.
Very cool! I set it up on Vertrauen.
Here's one quick change I made so that it pulls the wunderground API from the ctrl/modopts.ini, rather than having it hard-coded in the script:
Replacing this:
var wungrndAPIkey = "xxxxx";
with this:
var opts=load({},"modopts.js","SyncWX"); (added fix from 2nd msg)
var wungrndAPIkey = opts.wungrndAPIkey;
And then add the following to your ctrl/modopts.ini:
[SyncWX]
wungrndAPIkey = <your API key here>
You can change the section and key name in the modopts.ini file however you like, but just make sure that you keep your weather.js in-sync with those changes. This allows a sysop to update their weather.js in the future without losing their local change (the configuration).
If you have other configuration settings (e.g. weathericon_ext, local IP address, etc.), you can also move them to the modopts.ini (add more keys to the "SyncWX" section).
One other change I made, not because I really needed it, but because the hard-coded "8.8.8.8" IP address kind of bugged me:
var weather_ip_address = resolve_ip(system.inet_addr);
Granted, this won't work for some sysops who use their router/gateway as their DNS server and have it configured to "lie" about the actual IP address of their public hostname by giving them their local/private/LAN address instead.
Thanks! This is very cool. And if you want to have it committed maintained in cvs.synchro.net (instead-of or in-addition-to GitHub or whatever), let me know.
Well, I decided to work on nola's script (syncWX) and create some new icons based on the Wego set of icons, and finally I came out with a finished product I call syncWXremix.
Here's some links:
http://bbs.kd3.us/kd3doors.ssjs
https://github.com/KenDB3/syncWXremix
Feel free to have a look and if you are adventurous maybe even set it up.
Hi KenDB3 - I downloaded this and set it up on my BBS according to the documentation, but when it runs, it shows this error:
!JavaScript D:\BBS\sbbs\xtrn\syncWX\weather.js line 70: TypeError: cu.current_observation is undefined
Have you seen that error before?
1) Using HTML5 ftelnet, the Web Socket Service running on my BBS reports back as the IP of the BBS... on my local LAN. In my case it was a 192.168.x.x IP, and that fails the GeoIP lookup.
2) Same problem, different way of manifesting. I was on a wireless device, using a Putty Client, and the device was connected to the WiFi on the same network as my BBS, so again, I came through as 192.168.x.x.
So, the fix for my first description was the hard coded system IP that digital man was suggesting a better fix for. Listed as steps 5 & 6 in my sysop.txt file for the external program setup.
Please let me know if this helps fix, or at least identify, the problem. I haven't seen it fail with that error for any other reason besides non-public IPs.
Well, I decided to work on nola's script (syncWX) and create some new icons based on the Wego set of icons, and finally I came out with a finished product I call syncWXremix.
Here's some links:
http://bbs.kd3.us/kd3doors.ssjs
https://github.com/KenDB3/syncWXremix
Re: Sync Weather App - syncWXremix
By: Digital Man to KenDB3 on Wed Dec 23 2015 09:54 pm
Well, I decided to work on nola's script (syncWX) and create some new
icons based on the Wego set of icons, and finally I came out with a
finished product I call syncWXremix.
Here's some links:
http://bbs.kd3.us/kd3doors.ssjs
https://github.com/KenDB3/syncWXremix
Feel free to have a look and if you are adventurous maybe even set it
up.
Very cool! I set it up on Vertrauen.
Here's one quick change I made so that it pulls the wunderground API from the ctrl/modopts.ini, rather than having it hard-coded in the script:
Replacing this:
var wungrndAPIkey = "xxxxx";
with this:
var opts=load({},"modopts.js","SyncWX"); (added fix from 2nd msg)
var wungrndAPIkey = opts.wungrndAPIkey;
And then add the following to your ctrl/modopts.ini:
[SyncWX]
wungrndAPIkey = <your API key here>
You can change the section and key name in the modopts.ini file however you like, but just make sure that you keep your weather.js in-sync with those changes. This allows a sysop to update their weather.js in the future without losing their local change (the configuration).
If you have other configuration settings (e.g. weathericon_ext, local IP address, etc.), you can also move them to the modopts.ini (add more keys to the "SyncWX" section).
Thanks for the feedback digital man! I'll work on those :-) I have learned a lot just working through this app, and any tips and tricks are definitely welcome.
One other change I made, not because I really needed it, but because the hard-coded "8.8.8.8" IP address kind of bugged me:
var weather_ip_address = resolve_ip(system.inet_addr);
Granted, this won't work for some sysops who use their router/gateway as their DNS server and have it configured to "lie" about the actual IP address of their public hostname by giving them their local/private/LAN address instead.
That's a neat trick! What I noticed is if the IP comes back as a private IP, the JSON query fails pretty hard. The hard coded was all I could think of.
Thanks! This is very cool. And if you want to have it committed maintained in cvs.synchro.net (instead-of or in-addition-to GitHub or whatever), let me know.
I think at some point, yes, that would be cool. Not quite yet... but I'll ping you when I feel a bit more confident, lol.
Re: Sync Weather App - syncWXremix
By: KenDB3 to Nightfox on Fri Dec 25 2015 22:38:54
1) Using HTML5 ftelnet, the Web Socket Service running on my BBS reports back as the IP of the BBS... on my local LAN. In my case it was a 192.168.x.x IP, and that fails the GeoIP lookup.
2) Same problem, different way of manifesting. I was on a wireless device, using a Putty Client, and the device was connected to the WiFi on the same network as my BBS, so again, I came through as 192.168.x.x.
So, the fix for my first description was the hard coded system IP that digital man was suggesting a better fix for. Listed as steps 5 & 6 in my sysop.txt file for the external program setup.
Please let me know if this helps fix, or at least identify, the problem. I haven't seen it fail with that error for any other reason besides non-public IPs.
I saw that happening with me too - Since I was connecting from my own network, I was getting an IP address of 192.168.1.x (wired or wireless, wouldn't make a difference).
I ended up changing the script (near line 38) so that rather than checking for one specific IP address, it checks to see if the user's IP address begins with 192.168.1 (which is what my local network uses), and if that's the case, it resolves my BBS's public IP address, and otherwise just uses the user's IP address:
// If the user is on my home network, then use my BBS's public IP address. // Otherwise, use the user's (remote) IP address.
if (user.ip_address.indexOf("192.168.1") == 0)
var weather_ip_address = resolve_ip(system.inet_addr);
else
var weather_ip_address = user.ip_address;
Nightfox
Re: Sync Weather App - syncWXremix
By: KenDB3 to All on Wed Dec 23 2015 11:40:15
Well, I decided to work on nola's script (syncWX) and create some new icons based on the Wego set of icons, and finally I came out with a finished product I call syncWXremix.
Here's some links:
http://bbs.kd3.us/kd3doors.ssjs
https://github.com/KenDB3/syncWXremix
I like it, and I've also put it in my Synchronet filebase for download. One thing I noticed is that since the FILE_ID.DIZ has pipe symbols (|), my BBS seems to be interpreting some of the text as color codes and is thus cutting off a few of the characters (I think Renegade uses color codes using the pipe character). This is a screenshot of what the FILE_ID.DIZ description looks like on my BBS:
http://bit.ly/22t1gvM
Nightfox
Very cool! I set it up on Vertrauen.
Here's one quick change I made so that it pulls the wunderground API from the ctrl/modopts.ini, rather than having it hard-coded in the script:
Replacing this:
var wungrndAPIkey = "xxxxx";
with this:
var opts=load({},"modopts.js","SyncWX"); (added fix from 2nd msg) var wungrndAPIkey = opts.wungrndAPIkey;
And then add the following to your ctrl/modopts.ini:
[SyncWX]
wungrndAPIkey = <your API key here>
You can change the section and key name in the modopts.ini file however you like, but just make sure that you keep your weather.js in-sync with those changes. This allows a sysop to update their weather.js in the future without losing their local change (the configuration).
If you have other configuration settings (e.g. weathericon_ext, local IP address, etc.), you can also move them to the modopts.ini (add more keys to the "SyncWX" section).
Thanks for the feedback digital man! I'll work on those :-) I have learned a lot just working through this app, and any tips and tricks are definitely welcome.
One other change I made, not because I really needed it, but because the hard-coded "8.8.8.8" IP address kind of bugged me:
var weather_ip_address = resolve_ip(system.inet_addr);
Granted, this won't work for some sysops who use their router/gateway as their DNS server and have it configured to "lie" about the actual IP address of their public hostname by giving them their local/private/LAN address instead.
That's a neat trick! What I noticed is if the IP comes back as a private IP, the JSON query fails pretty hard. The hard coded was all I could think of.
Thanks! This is very cool. And if you want to have it committed maintained in cvs.synchro.net (instead-of or in-addition-to GitHub or whatever), let me know.
I think at some point, yes, that would be cool. Not quite yet... but I'll ping you when I feel a bit more confident, lol.
Here's another change I made today when I started to getting local alerts:
Replaced this:
console.putmsg(rd + "\001iPress any key to read the full alert\001n");
console.gotoxy(1,22);
console.crlf();
console.pause();
console.clear();
console.putmsg(rd + cu.alerts[0].message);
with this:
if(console.yesno("Read the full alert"))
console.putmsg(rd + cu.alerts[0].message);
In the original code, the viewing of the alert details could be skipped by hitting 'N' or Ctrl-C at the pause prompt, but most users won't know that.
digital man
Re: Sync Weather App - syncWXremix
By: KenDB3 to Nightfox on Fri Dec 25 2015 22:38:54
I like the fix; into the list of changes it goes, lol. I'm away from home for the holiday, but plan to work on it again when I get back.
Hi KenDB3 - I downloaded this and set it up on my BBS according to the documentation, but when it runs, it shows this error:
!JavaScript D:\BBS\sbbs\xtrn\syncWX\weather.js line 70: TypeError: cu.current_observation is undefined
Re: Re: Sync Weather App - syncWXremix
By: KenDB3 to Nightfox on Sat Dec 26 2015 10:14 pm
Re: Sync Weather App - syncWXremix
By: KenDB3 to Nightfox on Fri Dec 25 2015 22:38:54
I like the fix; into the list of changes it goes, lol. I'm away from home for the holiday, but plan to work on it again when I get back.
Regardubg tge weather app, I like it so far! Just saying... :)
Sincerely,
Jon Justvig
Given the bad weather around my neck of the woods this weekend, I figured it was a perfect time to give it a try.
Nicely done, Ken. I really like it!
My main suggestion would be to find some way to trap the error if there's a problem with the api lookup, so that it tells the user something descriptive about what went wrong and then quits gracefully back to the BBS.
--Josh
KenDB3 wrote to Jon Justvig <=-
Re: Re: Sync Weather App - syncWXremix
By: KenDB3 to Nightfox on Sat Dec 26 2015 10:14 pm
Regardubg tge weather app, I like it so far! Just saying... :)
Sincerely,
Jon Justvig
Thanks Jon! Glad you like it!
Hi KenDB3 - I downloaded this and set it up on my BBS according to the documentation, but when it runs, it shows this error: !JavaScript D:\BBS\sbbs\xtrn\syncWX\weather.js line 70: TypeError: cu.current_observation is undefined
Ken,
This is the exact same error i'm getting. Have tried using my public
ip instead of the Github but still get same result. :(
Hi KenDB3 - I downloaded this and set it up on my BBS according t the documentation, but when it runs, it shows this error: !JavaScript D:\BBS\sbbs\xtrn\syncWX\weather.js line 70: TypeError cu.current_observation is undefined
Ken,
This is the exact same error i'm getting. Have tried using my public
ip instead of the Github but still get same result. :(
to use Nightfox's solution in my next update. For now, maybe see if you can test from Ree's page: http://my.ftelnet.ca. It will proxy it and will come f a public IP. If its working for others off of your local network, then hopefully you can see it working this way. If not, let me know (I might have few questions to narrow down the issue).
Yes, i am logging in locally on the network via 192.168.*.*. I did try Nightfox's replacement but it had the same result. :(
Yes, i am logging in locally on the network via 192.168.*.*. I did try Nightfox's replacement but it had the same result. :(
Yes, i am logging in locally on the network via 192.168.*.*. I did try Nightfox's replacement but it had the same result. :(
What IP addresses does your home network use? My home network IPs are 192.168.1.*, so if your 3rd digit is (or can be) something other than 1, you
!JavaScript D:\BBS\sbbs\xtrn\syncWX\weather.js line 70: TypeError cu.current_observation is undefined
Ken,
This is the exact same error i'm getting. Have tried using my public
Hmmm.. are you by chance logging in from a device on the same network (router/wireless)? Nightfox saw this issue (and I did too). I'm probably goi
Hi KenDB3 - I downloaded this and set it up on my BBS according t the documentation, but when it runs, it shows this error: !JavaScript D:\BBS\sbbs\xtrn\syncWX\weather.js line 70: TypeError cu.current_observation is undefined
Ken,
This is the exact same error i'm getting. Have tried using my public ip instead of the Github but still get same result. :(
to use Nightfox's solution in my next update. For now, maybe see if you can test from Ree's page: http://my.ftelnet.ca. It will proxy it and will come f a public IP. If its working for others off of your local network, then hopefully you can see it working this way. If not, let me know (I might have few questions to narrow down the issue).
Yes, i am logging in locally on the network via 192.168.*.*. I did try Nightfox's replacement but it had the same result. :(
Also tried the ftelnet embed going through the proxy in Georgia but
again had the same result. Bummed out it's not working for me but
i'm happy it's working for so many others. Hat's off, Ken. Great
work!
Any ideas or thoughts greatly appreciated.
Best wishes
Yes, i am logging in locally on the network via 192.168.*.*. I did try Nightfox's replacement but it had the same result. :(
Hi KenDB3 - I'm wondering if there could be an option loaded from a configuration file to specify a local network IP identification so that sysops wouldn't have to modify the JavaScript source. A sysop could put something like 192.168 in that configuration option, and if the script finds that in the user's IP address (similar to the fix I used), then it would resolve the BBS's IP address.
Nightfox
Here's one quick change I made so that it pulls the wunderground API from the ctrl/modopts.ini, rather than having it hard-coded in the script:
Replacing this:
var wungrndAPIkey = "xxxxx";
with this:
var opts=load({},"modopts.js","SyncWX");
var wungrndAPIkey = opts.wungrndAPIkey;
And then add the following to your ctrl/modopts.ini:
[SyncWX]
wungrndAPIkey = <your API key here>
You can change the section and key name in the modopts.ini file however you like, but just make sure that you keep your weather.js in-sync with those changes. This allows a sysop to update their weather.js in the future without losing their local change (the configuration).
If you have other configuration settings (e.g. weathericon_ext, local IP address, etc.), you can also move them to the modopts.ini (add more keys to the "SyncWX" section).
i'm happy it's working for so many others. Hat's off, Ken. Great
work!
Ok, thanks for doing the ftelnet test (and thanks for the encouragement). I don't think you are having a problem with a Private IP (I logged in as guest your BBS and saw the problem as well). I'm wondering if it is an API Key iss
!JavaScript D:\BBS\sbbs\xtrn\syncWX\weather.js line 70: TypeError cu.current_observation is undefined
Ken,
This is the exact same error i'm getting. Have tried using my public
Hmmm.. are you by chance logging in from a device on the same network (router/wireless)? Nightfox saw this issue (and I did too). I'm probably goi
KenDB3, It's working now. My goofy ass mistake with the local lan ip.
Thank you!
... Ever meet a Sysop who would admit the problem was his?
i'm happy it's working for so many others. Hat's off, Ken. Great
work!
Ok, thanks for doing the ftelnet test (and thanks for the encouragement). I don't think you are having a problem with a Private IP (I logged in as guest your BBS and saw the problem as well). I'm wondering if it is an API Key iss
Thanks, Ken. Everything works great when i login with my Sysop
credentials. The door is setup to display at login.
Like you've already mentioned, the GUEST account doesn't work
at login but i noticed when accessed from the external menu,
it works with the GUEST account.
Does that make any sense?
Like you've already mentioned, the GUEST account doesn't work
at login but i noticed when accessed from the external menu,
it works with the GUEST account.
Does that make any sense?
Can you define "doesn't work"?
Like you've already mentioned, the GUEST account doesn't work
at login but i noticed when accessed from the external menu,
it works with the GUEST account.
Does that make any sense?
Can you define "doesn't work"?
Sure. I meant that the following error continues to show up:
error: !JavaScript D:\BBS\sbbs\xtrn\syncWX\weather.js line 70:
TypeError cu.current_observation is undefined
I think i spoke to soon though when i said everything was ok because i noticed when Ken logged back into my system as a registered user the
error showed up again in the logs.
When i login as Sysop everything works, which is why i thought all was
good to go.
Thanks Josh! I agree, I'd like to find a way to handle that better, but I might need some help with that (if anyone out there is interested... hint hint :-P ).
Like you've already mentioned, the GUEST account doesn't work
at login but i noticed when accessed from the external menu,
it works with the GUEST account.
Does that make any sense?
Can you define "doesn't work"?
Sure. I meant that the following error continues to show up:
error: !JavaScript D:\BBS\sbbs\xtrn\syncWX\weather.js line 70:
TypeError cu.current_observation is undefined
I think i spoke to soon though when i said everything was ok because i noticed when Ken logged back into my system as a registered user the
error showed up again in the logs.
When i login as Sysop everything works, which is why i thought all was
good to go.
Thanks Josh! I agree, I'd like to find a way to handle that better, but I might need some help with that (if anyone out there is interested... hint hint :-P ).
Okay, Ken, I went ahead and wrote up some code to test for error messages in the JSON response. I sent you a pull request on GitHub. Feel free to use my suggestions, or write your own better version!
Also, I noticed k5jat created an issue on GitHub about a non-geolocating method for getting the data. The API *does* support queries that specify either city/state or zip code. I wonder if you might consider a fallback for cases where IP-based queries fail that builds a new query URL using SBBS' system.location variable.
Thanks Josh! I agree, I'd like to find a way to handle that better,
but I might need some help with that (if anyone out there is
interested... hint hint :-P ).
Okay, Ken, I went ahead and wrote up some code to test for error messages in the JSON response. I sent you a pull request on GitHub. Feel free to use my suggestions, or write your own better version!
Also, I noticed k5jat created an issue on GitHub about a non-geolocating method for getting the data. The API *does* support queries that specify either city/state or zip code. I wonder if you might consider a fallback for cases where IP-based queries fail that builds a new query URL using SBBS' system.location variable.
Re: Re: Sync Weather App - syncWXremix
By: Kirkman to KenDB3 on Tue Dec 29 2015 11:16 pm
Thanks Josh! I agree, I'd like to find a way to handle that better,
but I might need some help with that (if anyone out there is
interested... hint hint :-P ).
Okay, Ken, I went ahead and wrote up some code to test for error messages in the JSON response. I sent you a pull request on GitHub. Feel free to use my suggestions, or write your own better version!
I actually had worked something out, but I like yours better, lol. I've pulled it into the code. I might add something else, but I'm not sure if its better as an on-screen alert or as part of the Log, but I was going to add a visual of the request string that was sent to wunderground.com as a way of further seeing what happened. Thoughts?
Also, I noticed k5jat created an issue on GitHub about a non-geolocating method for getting the data. The API *does* support queries that specify either city/state or zip code. I wonder if you might consider a fallback for cases where IP-based queries fail that builds a new query URL using SBBS' system.location variable.
Thanks for pointing it out, I responded there, but I will give you my thoughts here. I like the idea of a fall back, but my concern with system.location is it might not match up with the data needed to form a query. For example, mine is set to just "Rhode Island" with no city. But, maybe we can come up with something, I am definitely open to suggestions and am happy to have people throwing in some code.
Also, what is your private IP scheme on your local network (if you don't min posting here or maybe you could email it to me instead)? Do you have 192.168.1.x, 192.168.100.x, etc... or is it something like 10.x.x.x?
I'd love to see it fixed for you.
You could log it for the sysop with the the log() function. Use log(LOG_DEBUG,...) if you want it to only be displayed when the sysop has chosen to view debug-level log output.
Also, I noticed k5jat created an issue on GitHub about a
non-geolocating method for getting the data. The API *does*
support queries that specify either city/state or zip code. I
wonder if you might consider a fallback for cases where IP-based
queries fail that builds a new query URL using SBBS'
system.location variable.
Thanks for pointing it out, I responded there, but I will give you my
thoughts here. I like the idea of a fall back, but my concern with
system.location is it might not match up with the data needed to form
a query. For example, mine is set to just "Rhode Island" with no city.
But, maybe we can come up with something, I am definitely open to
suggestions and am happy to have people throwing in some code.
The modopts.ini could also be used to provide a postal/zip code for the system (but I think the user's location/postal/zip would be better).
Also, what is your private IP scheme on your local network (if you
don't min posting here or maybe you could email it to me instead)? Do
you have 192.168.1.x, 192.168.100.x, etc... or is it something like
Ok, i'm not exactly sure where i was muffin' things up at but below is
the code that eventually worked for me. Had a friend dial in and he claimed it looked great and loves the weather reports. Also no error's were noted in the logs this time.
if (user.ip_address.indexOf("192.168.0") == 0) {
var weather_ip_address = resolve_ip(system.inet_addr);
} else {
var weather_ip_address = "my.public.ip";
}
Thanks guys for all your help and assistance. I really appreciate it
and love this gem of a program.
Re: Re: Sync Weather App - syncWXremix
By: Digital Man to KenDB3 on Wed Dec 30 2015 12:39 am
You could log it for the sysop with the the log() function. Use log(LOG_DEBUG,...) if you want it to only be displayed when the sysop has chosen to view debug-level log output.
I totally used this. Thanks for the tip!
Also, I noticed k5jat created an issue on GitHub about a
non-geolocating method for getting the data. The API *does*
support queries that specify either city/state or zip code. I
wonder if you might consider a fallback for cases where IP-based Ki>> queries fail that builds a new query URL using SBBS'
system.location variable.
Thanks for pointing it out, I responded there, but I will give you my
thoughts here. I like the idea of a fall back, but my concern with
system.location is it might not match up with the data needed to form
a query. For example, mine is set to just "Rhode Island" with no city.
But, maybe we can come up with something, I am definitely open to
suggestions and am happy to have people throwing in some code.
The modopts.ini could also be used to provide a postal/zip code for the system (but I think the user's location/postal/zip would be better).
I implemented something for the Sysop to define either US Postal ZIP Code or an Aiport Code (ICAO or IATA, but ICAO seems better). This way it will work for US and Non-US.
I'd love a reliable way to get the user's location, but I'm stymied as to how. Quick question though... I remember reading that anything ran as a Logon event could not have interactive input. Is that still true. It is not mentioned in the Wiki for installing doors, but it is mentioned here: http://synchro.net/docs/external_programs.html
My thought is, there is no better way to get an answer than by asking someone. I have users that only put a partial location when creating a user, or type something incorrectly, or just make stuff up. So, I don't think using their user data is a good option. But asking them to provide a ZIP or Airport code within the app itself might work well.
This all looks good. But for some reason when I log into your BBS, I see the weather report for your area (Evansville, IN). I'm not sure what... but, I j put together all the recent updates from GitHub into a new ZIP file for download if you feel like giving it a shot. New setup instructions thanks to digital man's suggestion of using ctrl/modopts.ini.
ver. 1.01b
I slapped a "b" at the end of the version number, because no one else has tested it but me (that I know of).
ver. 1.01b
Just now got it working. Thanks. Was unable to get my nonip ICAO code
My thought is, there is no better way to get an answer than by asking someone. I have users that only put a partial location when creating a user, or type something incorrectly, or just make stuff up. So, I don't think using their user data is a good option. But asking them to provide a ZIP or Airport code within the app itself might work well.
There are services that you can query from JavaScript where you provide an IP address, and they give you (at least approximately) the location of that IP address. That way, you wouldn't have to ask the user (unless perhaps you wanted to be sure you got more precise information).
A couple search results I found: http://stackoverflow.com/questions/4937517/ip-to-location-using-javascript http://bit.ly/1MIRMRB
There are services that you can query from JavaScript where you provide an IP address, and they give you (at least approximately) the location of that IP address. That way, you wouldn't have to ask the user (unless perhaps you wanted to be sure you got more precise information).
A couple search results I found: http://stackoverflow.com/questions/4937517/ip-to-location-using-javascript http://bit.ly/1MIRMRB
We do have 'exec/load/geoip.js' for this, if it still works. Not sure if it or any alternative would be much better or worse than weather underground's existing geo-IP stuff, though.
The programs/scripts configured via SCFG->External Programs->Fixed Events cannot have user interaction. Programs/scripts configured to run via SCFG->External Programs->Online Programs *can* have user interaction.
My thought is, there is no better way to get an answer than by asking
someone. I have users that only put a partial location when creating a
user, or type something incorrectly, or just make stuff up. So, I
don't think using their user data is a good option. But asking them to
provide a ZIP or Airport code within the app itself might work well.
Sure. Though, I'd only ask them if you can't derive it from the zip/postal code in their user record or from their current IP address.
Once again i got ahead of myself. Dial up user phoned in and received
this error:
"Error in weather.js api.underground.com returned a 'querynotfound'
error with this description. 'No cities match your search query'."
As previously mentioned, it's working for me locally. Also as stated
in my last message, for "fallback_type", i'm using "bbsip" because
i wasn't able to get the ICAO or zip to work for me.
Never had a "modopts.ini" file in my Ctrl directory so i created one.
Here is the contents of that file:
[syncWX]
wungrndAPIkey = my api key
weathericon_ext = .asc
fallback_type = bbsip
fallback =
Do i have the above right?
information).There are services that you can query from JavaScript where you
provide an IP address, and they give you (at least approximately)
the location of that IP address. That way, you wouldn't have to ask
the user (unless perhaps you wanted to be sure you got more precise
A couple search results I found:
http://stackoverflow.com/questions/4937517/ip-to-location-using-java
script http://bit.ly/1MIRMRB
We do have 'exec/load/geoip.js' for this, if it still works. Not sure
if it or any alternative would be much better or worse than weather
underground's existing geo-IP stuff, though.
Ah, interesting. I didn't realize that was there.
[syncWX]
wungrndAPIkey = my api key
weathericon_ext = .asc
fallback_type = bbsip
fallback =
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?
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?
In the meantime, I never really thought about Dial-up users and I need some way of sorting that out...
Re: Re: Sync Weather App - syncWXremix
By: tbirdsradio to KenDB3 on Thu Dec 31 2015 09:34 am
Once again i got ahead of myself. Dial up user phoned in and received this error:
"Error in weather.js api.underground.com returned a 'querynotfound' error with this description. 'No cities match your search query'."
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?
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.
Re: Sync Weather App - syncWXremix
By: KenDB3 to All on Wed Dec 23 2015 11:40:15
Hi KenDB3,
I noticed something a little odd when running syncWXremix from my external programs menu while logged into my BBS. If you press Q any time while it's running (i.e., at the pause at the end of the weather report, or while you're reading the full alert), it quits back to the external programs menu (which is probably expected), but Synchronet doesn't output any of the items for the external programs menu. I can still type a number to run one of the doors though, so it only seems to be affecting the configuration. I'm not sure if this is due to something happening in syncWXremix or due to something with the way Synchronet handles JavaScript mods, but wanted to let you know.
I've captured some screenshots to illustrate what's going on. For instance, this is what my General/Misc. external programs menu normally looks like: http://bit.ly/1PC37JD
In syncWXremix, if I'm at the screen pause:
http://bit.ly/1R5pZ5J
If I press Q right there, it quits back to my General/Misc. doors menu, but none of the doors are listed:
http://bit.ly/1mVQwpr
DM said it would be cool if someone made one for Sync, and nolageek had posted that he had started such a project and put it on GitHub.
Well, I decided to work on nola's script (syncWX) and create some new icons based on the Wego set of icons, and finally I came out with a finished product I call syncWXremix.
DM said it would be cool if someone made one for Sync, and nolageek had posted that he had started such a project and put it on GitHub.
Well, I decided to work on nola's script (syncWX) and create some new icons based on the Wego set of icons, and finally I came out with a finished product I call syncWXremix.
Hi KenDB3 - I downloaded this and set it up on my BBS according to
the documentation, but when it runs, it shows this error:
!JavaScript D:\BBS\sbbs\xtrn\syncWX\weather.js line 70: TypeError:
cu.current_observation is undefined
I noticed something a little odd when running syncWXremix from my
external programs menu while logged into my BBS. If you press Q any
time while it's running (i.e., at the pause at the end of the weather
report, or while you're reading the full alert), it quits back to the
external programs menu (which is probably expected), but Synchronet
doesn't output any of the items for the external programs menu. I can
I tried to reproduce this, but could not. What revision of exec/xtrn_sec.js do you have? 1.15 is the latest. It sound like the console "abort" flag isn't being cleared when returning from the script (hitting 'Q' or Ctrl-C from the pause prompt will set this flag), but if I can't reproduce the problem it'll be hard to fix.
Re: Sync Weather App - syncWXremix
By: Digital Man to Nightfox on Fri Jan 01 2016 20:37:55
I noticed something a little odd when running syncWXremix from my
external programs menu while logged into my BBS. If you press Q any
time while it's running (i.e., at the pause at the end of the weather
report, or while you're reading the full alert), it quits back to the
external programs menu (which is probably expected), but Synchronet
doesn't output any of the items for the external programs menu. I can
I tried to reproduce this, but could not. What revision of exec/xtrn_sec.js do you have? 1.15 is the latest. It sound like the console "abort" flag isn't being cleared when returning from the script (hitting 'Q' or Ctrl-C from the pause prompt will set this flag), but if I can't reproduce the problem it'll be hard to fix.
My xtrn_sec.js was version 1.14, so I replaced it with 1.15 but still saw the same issue.
I'm still using the Synchronet 1.16c official release and haven't updated to any of the 1.17 builds yet. Do you think that might have something to do with what I'm seeing?
Re: Re: Sync Weather App - syncWXremix
By: KenDB3 to tbirdsradio on Fri Jan 01 2016 08:11 am
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.
Dial-up with SEXPOTS worked like a champ for me today! No error in the logs unlike yesterday. Wanted to let you know as soon as i found out. YES!!!
I noticed something a little odd when running syncWXremix from my
external programs menu while logged into my BBS. If you press Q
any time while it's running (i.e., at the pause at the end of the
weather report, or while you're reading the full alert), it quits
back to the external programs menu (which is probably expected),
but Synchronet doesn't output any of the items for the external
programs menu. I can
I'm still using the Synchronet 3.16c official release and haven't
updated to any of the 3.17 builds yet. Do you think that might have
something to do with what I'm seeing?
I reviewed the changes since v3.16 to the files I would think might have an impact on this behavior and couldn't find any changes which seemed related/relevant. It's possible I missed something somewhere.
Can you try the current dev build (3.17a) and see what you find? You can always go back to 3.16c if you have an issue.
!JavaScript D:\BBS\sbbs\xtrn\syncWX\weather.js line 70:
TypeError: cu.current_observation is undefined
I wrote the original syncWX and I get this error too, but I've only noticed it when calling from the local network, not when I call in from an outside IP. Not sure if that's what you're doing to?
Dial-up with SEXPOTS worked like a champ for me today! No error in the logs unlike yesterday. Wanted to let you know as soon as i found out. YES!!!
Re: Sync Weather App - syncWXremix
By: Digital Man to Nightfox on Fri Jan 01 2016 23:15:57
I noticed something a little odd when running syncWXremix from my
external programs menu while logged into my BBS. If you press Q
any time while it's running (i.e., at the pause at the end of the
weather report, or while you're reading the full alert), it quits
back to the external programs menu (which is probably expected),
but Synchronet doesn't output any of the items for the external
programs menu. I can
I'm still using the Synchronet 3.16c official release and haven't
updated to any of the 3.17 builds yet. Do you think that might have
something to do with what I'm seeing?
I reviewed the changes since v3.16 to the files I would think might have an impact on this behavior and couldn't find any changes which seemed related/relevant. It's possible I missed something somewhere.
Can you try the current dev build (3.17a) and see what you find? You can always go back to 3.16c if you have an issue.
I downloaded & copied the latest 3.17a build, but I still see the same issue with my external programs not being written after pressing Q to quit out of syncWXremix. It must be something else with my system, but I'm not sure what that would be. A configuration file perhaps?
Re: Sync Weather App - syncWXremix
By: Nightfox to Digital Man on Sat Jan 02 2016 09:42 am
Re: Sync Weather App - syncWXremix
By: Digital Man to Nightfox on Fri Jan 01 2016 23:15:57
I noticed something a little odd when running syncWXremix from my >>> external programs menu while logged into my BBS. If you press Q >>> any time while it's running (i.e., at the pause at the end of the >>> weather report, or while you're reading the full alert), it quits >>> back to the external programs menu (which is probably expected), >>> but Synchronet doesn't output any of the items for the external >>> programs menu. I can
I'm still using the Synchronet 3.16c official release and haven't
updated to any of the 3.17 builds yet. Do you think that might have
something to do with what I'm seeing?
I reviewed the changes since v3.16 to the files I would think might have an impact on this behavior and couldn't find any changes which seemed related/relevant. It's possible I missed something somewhere.
Can you try the current dev build (3.17a) and see what you find? You can always go back to 3.16c if you have an issue.
I downloaded & copied the latest 3.17a build, but I still see the same issue with my external programs not being written after pressing Q to quit out of syncWXremix. It must be something else with my system, but I'm not sure what that would be. A configuration file perhaps?
What command-shell are you using? Does the command-shell actually execute the exec/xtrn_sec.js script or is it just using the old internal xtrn_sec function? I think that might explain the difference in behavior seen.
What command-shell are you using? Does the command-shell actually execute the exec/xtrn_sec.js script or is it just using the old internal xtrn_sec function? I think that might explain the difference in behavior seen.
Re: Sync Weather App - syncWXremix
By: Digital Man to Nightfox on Sat Jan 02 2016 13:35:25
What command-shell are you using? Does the command-shell actually execute the exec/xtrn_sec.js script or is it just using the old internal xtrn_sec function? I think that might explain the difference in behavior seen.
I'm using my own custom command shell (written in JavaScript). It's calling the bbs.xtrn_sec() function. I updated my command shell to run xtrn_sec.js instead:
bbs.exec("?xtrn_sec.js");
With that change, the issue with not displaying the menu items after pressing 'Q' is no longer happening. And I'm still using version 1.15 of xtrn_sec.js (with the Synchronet 3.17 nightly build).
I just came across this on github the other day and was checking it out. I love what you did with it, especially moving the config to the mod options file. Good stuff!
Hi KenDB3 - I downloaded this and set it up on my BBS according
to the documentation, but when it runs, it shows this error:
!JavaScript D:\BBS\sbbs\xtrn\syncWX\weather.js line 70:
TypeError: cu.current_observation is undefined
I wrote the original syncWX and I get this error too, but I've only noticed it when calling from the local network, not when I call in from an outside IP. Not sure if that's what you're doing to?
Dial-up with SEXPOTS worked like a champ for me today! No error in
the logs unlike yesterday. Wanted to let you know as soon as i found
out. YES!!!
This morning with the dial-up user i noticed the error popped up again. 'querynotfound'. 'No cities match your search query'.
Below is how SEXPOTS passes the info into the Terminal Server Log:
SEXPOTS connection detected at 115200 bps
CID: XXXXXXXXXX LAST,FIRST // X = Phone number w/area-code, followed by name
At a lost to explain why all was good yesterday but today the error.
I fixed xtrn_sec.js to behave the same as the internal xtrn_sec function in this regard and also committed a change to sbbs itself to clear the console-abort flag after executing any JS or Baja modules. This might be overkill, but does fix the observed problem.
Re: Sync Weather App - syncWXremix
By: Digital Man to Nightfox on Sat Jan 02 2016 02:10 pm
I fixed xtrn_sec.js to behave the same as the internal xtrn_sec function in this regard and also committed a change to sbbs itself to clear the console-abort flag after executing any JS or Baja modules. This might be overkill, but does fix the observed problem.
Is there anything I should do/add that would help avoid this for anyone that hasn't updated? Just curious.
Re: Sync Weather App - syncWXremix
By: KenDB3 to Digital Man on Sat Jan 02 2016 11:16 pm
Re: Sync Weather App - syncWXremix
By: Digital Man to Nightfox on Sat Jan 02 2016 02:10 pm
I fixed xtrn_sec.js to behave the same as the internal xtrn_sec function in this regard and also committed a change to sbbs itself to clear the console-abort flag after executing any JS or Baja modules. This might be overkill, but does fix the observed problem.
Is there anything I should do/add that would help avoid this for anyone that hasn't updated? Just curious.
The script could clear the abort flag before terminating. The code would be:
console.aborted = false;
Something else that should be addressed: When using a non-ANSI terminal (or just disabling ANSI for the user) causes the door to not display very well:
.---. .--.
.-( ). )
(___.__)___)___)
`,`,`,`,`,`,`
,`,`,`,`,`,`,`Your Location: Irvine, CACurrent Conditions: RainTemp: 55.2ø F (
12.9ø C)Sunrise/Sunset: 6:56 / 16:56Lunar Phase: Waning CrescentWind: From the S
SW at 2.7 MPH UV Index: 0TuesdayRainLo / Hi49 / 57 øFWednesdayRainLo / Hi48 /
55 øFThursdayRainLo / Hi44 / 55 øFFridayClearLo / Hi44 / 57 øFAreal Flood Advis
ory, Flash Flood Watch: 2:34 PM PST on January 5, 2016Expires 4:00 AM PST on Jan
uary 07, 2016[û] Read the full alert? [Yes] No
Whoa, that's ugly. Anyone have some tips to keep the spacing and CRLFs?
Whoa, that's ugly. Anyone have some tips to keep the spacing and CRLFs?
I usually just leave such users to wallow in the inadequacy of their terminals.
However, my guess would be that it's related to the copious use of console.gotoxy() in this script. You might want to throw in a 'simple' view for non-ANSI terminals, eg:
if (!(user.settings&USER_ANSI)) {
// print out weather info line-by-line
} else {
// your existing display-routine goes here
}
Whoa, that's ugly. Anyone have some tips to keep the spacing and
CRLFs?
I usually just leave such users to wallow in the inadequacy of their
terminals.
However, my guess would be that it's related to the copious use of
console.gotoxy() in this script. You might want to throw in a
'simple' view for non-ANSI terminals, eg:
if (!(user.settings&USER_ANSI)) {
// print out weather info line-by-line
} else {
// your existing display-routine goes here
}
echicken has good advice, but I just wanted to point out that the "more correct" method of checking the user's terminal capabilities would be: if(console.term_supports(USER_ANSI)) {
// send ANSI stuff
} else {
// send non-ANSI stuff
}
Whoa, that's ugly. Anyone have some tips to keep the spacing and
CRLFs?
I usually just leave such users to wallow in the inadequacy of their
terminals.
However, my guess would be that it's related to the copious use of
console.gotoxy() in this script. You might want to throw in a
'simple' view for non-ANSI terminals, eg:
if (!(user.settings&USER_ANSI)) {
// print out weather info line-by-line
} else {
// your existing display-routine goes here
}
echicken has good advice, but I just wanted to point out that the
"more correct" method of checking the user's terminal capabilities
would be: if(console.term_supports(USER_ANSI)) {
// send ANSI stuff
} else {
// send non-ANSI stuff
}
You guys rock!
Working on it right now.
GitHub page will have the fix shortly if you want to try it out. Just need to adjust for your extremely helpful input.
echicken has good advice, but I just wanted to point out that the "more correct" method of checking the user's terminal capabilities would be: if(console.term_supports(USER_ANSI)) {
echicken has good advice, but I just wanted to point out that the "more correct" method of checking the user's terminal capabilities would be: if(console.term_supports(USER_ANSI)) {
Good to know. I often wondered what the 'terminal flags' were, for use with console.term_supports, but never bothered to ask.
Aloha, nolageek! New code was added to the latest version that eliminated the error listed above.
I agree. Not that I am quite ready for that yet, I have more to learn to get to there. But, I am always open to help. It looks like people like the app, so maybe we can get it onto CVS now? :-)
Awesome, I'm probably going to switch to this new one pretty soon. Has a few more features than the one I did. :)
like the app, so maybe we can get it onto CVS now? :-)
It sounds like you're already using GitHub for revision control of this project. If you're happy with GitHub, then it might be best to just leave it there and make "releases" to Synchronet sysops the old fashioned way (e.g. uploading .zip files to BBSes, FTP servers, web-sites).
Though we tend to use the Synchronet CVS repository like a package distribution system, that's not really what it's intended use is for and often what's in CVS is broken in some way, sometimes intentionally, at least temporarily. Having "official" releases outside of CVS is preferred. I was mainly just offering CVS access to you for the revision control of this project, but if you already have it in GitHub, then you have that part covered (just remember to check-in early and often). :-)
I also wanted to say thank you, to you and the other great folks here that are helpful.
However, I am getting used to it, and (dare I say) I like it. In my head, I really do think of Sync CVS as a distro system, it's where I get some great games!
However, I am getting used to it, and (dare I say) I like it. In my
head, I really do think of Sync CVS as a distro system, it's where I
get some great games!
apt-get upgrade-synchronet
:)
Sysop: | MCMLXXIX |
---|---|
Location: | Prospect, CT |
Users: | 325 |
Nodes: | 10 (0 / 10) |
Uptime: | 03:07:56 |
Calls: | 510 |
Messages: | 220569 |