• Customizing underground weather bbs application

    From Terry Rankin@3:770/3 to All on Thursday, December 28, 2017 15:35:57
    Need to pass State and City (parameters) into the uweather program.

    We know the |UC is State and City (BBS user information codes)

    Mystic -cfg
    Under Editors/Menu Editor/default/main/(W) Weather/
    Command (Sub-menu)
    Can I choose DD (execute external program) from the menu option and data be: /mystic/scripts/xq-uweather/wu.sh summary |UC

    Meaning, will it resolve correctly?
    For example I need:
    /mystic/scripts/xq-uweather/wu.sh summary ohio dayton
    Need to pass 3 parameters

    If that won't work, how come I can't do this in MPL:

    MenuCmd('DD',Patch+'wu.sh summary |UC');

    It does not resolve to ohio dayton (for example), it show up as "|UC"!

    Odd to me since I see tons of color codes and other stuff with | (pipes) working correctly within MPL.

    I've been looking for examples of MPL programs passing user information codes/parameters. Not having much luck here.

    Thanks,
    Terry

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Nicholas Boel@1:154/10 to Terry Rankin on Friday, December 29, 2017 08:20:12
    Hello,

    On Thu Dec 28 2017 21:35:56 GMT, Terry Rankin -> All wrote:

    If that won't work, how come I can't do this in MPL:

    MenuCmd('DD',Patch+'wu.sh summary |UC');

    It does not resolve to ohio dayton (for example), it show up as "|UC"!

    I'm no MPL guru or anything, but have you tried taking the |UC out of quotes:

    MenuCmd('DD',Patch+'wu.sh summary'+|UC);

    And if that doesn't work, maybe there's an MPL function that you're supposed to
    use specifically when trying to print out MCI codes?

    Regards,
    Nick

    --- Claws Mail 3.15.0 (GTK+ 2.24.31; x86_64-w64-mingw32)
    * Origin: thePharcyde_ distribution system (1:154/10)
  • From Terry Rankin@3:770/3 to Nicholas Boel on Friday, December 29, 2017 09:17:09
    On Friday, December 29, 2017 at 9:55:16 AM UTC-5, Nicholas Boel wrote:
    Hello,

    On Thu Dec 28 2017 21:35:56 GMT, Terry Rankin -> All wrote:

    If that won't work, how come I can't do this in MPL:

    MenuCmd('DD',Patch+'wu.sh summary |UC');

    It does not resolve to ohio dayton (for example), it show up as "|UC"!

    I'm no MPL guru or anything, but have you tried taking the |UC out of quotes:

    MenuCmd('DD',Patch+'wu.sh summary'+|UC);

    And if that doesn't work, maybe there's an MPL function that you're supposed
    to
    use specifically when trying to print out MCI codes?

    Regards,
    Nick

    Just tried. Won't even compile. :(

    Makes me think the MenuCmd doesn't like these user info codes...

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From g00r00@1:129/215 to Terry Rankin on Friday, December 29, 2017 22:32:39
    Need to pass State and City (parameters) into the uweather program.

    These are not part of the door command line codes, but I could probably add this in for you.

    If that won't work, how come I can't do this in MPL:

    MenuCmd('DD',Patch+'wu.sh summary |UC');

    You have to convert it with MCI2STR. It'd be like this:

    MenuCmd('DD', Patch + 'wu.sh summary ' + mci2str('UC'));

    --- Mystic BBS v1.12 A37 2017/12/29 (Windows/32)
    * Origin: Sector 7 [Mystic BBS WHQ] (1:129/215)
  • From Terry Rankin@3:770/3 to All on Saturday, December 30, 2017 10:53:58
    On Saturday, December 30, 2017 at 12:35:28 AM UTC-5, g00r00 wrote:
    Need to pass State and City (parameters) into the uweather program.

    These are not part of the door command line codes, but I could probably add this in for you.

    If that won't work, how come I can't do this in MPL:

    MenuCmd('DD',Patch+'wu.sh summary |UC');

    You have to convert it with MCI2STR. It'd be like this:

    MenuCmd('DD', Patch + 'wu.sh summary ' + mci2str('UC'));

    You absolutely ROCK my friend! :)

    Works perfectly!!!

    You those who have this weather app (XQ-UWEATHER.ZIP), all you have to do is: modify wu.sh (Right under the apikey entry, modify state and city):
    state=$2
    city=$3

    and modify all the MenuCmd lines in xq-uweather.mps to add + mci2str('UC')
    Note the first MenuCmd line will change...
    From:
    MenuCmd('DD', Patch + 'wu.sh');
    To:
    MenuCmd('DD', Patch + 'wu.sh dummy ' + mci2str('UC'));

    The first part of the program doesn't use the first parameter...hence the 'dummy'.

    Thanks again!
    Terry

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Terry Rankin@3:770/3 to Terry Rankin on Saturday, December 30, 2017 10:58:20
    On Saturday, December 30, 2017 at 1:53:59 PM UTC-5, Terry Rankin wrote:
    On Saturday, December 30, 2017 at 12:35:28 AM UTC-5, g00r00 wrote:
    Need to pass State and City (parameters) into the uweather program.

    These are not part of the door command line codes, but I could probably add this in for you.

    If that won't work, how come I can't do this in MPL:

    MenuCmd('DD',Patch+'wu.sh summary |UC');

    You have to convert it with MCI2STR. It'd be like this:

    MenuCmd('DD', Patch + 'wu.sh summary ' + mci2str('UC'));

    You absolutely ROCK my friend! :)

    Works perfectly!!!

    You those who have this weather app (XQ-UWEATHER.ZIP), all you have to do is: modify wu.sh (Right under the apikey entry, modify state and city):
    state=$2
    city=$3

    and modify all the MenuCmd lines in xq-uweather.mps to add + mci2str('UC') Note the first MenuCmd line will change...
    From:
    MenuCmd('DD', Patch + 'wu.sh');
    To:
    MenuCmd('DD', Patch + 'wu.sh dummy ' + mci2str('UC'));

    The first part of the program doesn't use the first parameter...hence the
    'dummy'.

    Thanks again!
    Terry

    Of course this will only work if your account location is "state city". Meaning
    no comma or slash or any other variation. Probably could add a couple more lines of code to groom out any unwanted characters.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Terry Rankin@3:770/3 to Terry Rankin on Saturday, December 30, 2017 11:09:48
    On Saturday, December 30, 2017 at 1:58:20 PM UTC-5, Terry Rankin wrote:
    On Saturday, December 30, 2017 at 1:53:59 PM UTC-5, Terry Rankin wrote:
    On Saturday, December 30, 2017 at 12:35:28 AM UTC-5, g00r00 wrote:
    Need to pass State and City (parameters) into the uweather program.

    These are not part of the door command line codes, but I could probably
    add
    this in for you.

    If that won't work, how come I can't do this in MPL:

    MenuCmd('DD',Patch+'wu.sh summary |UC');

    You have to convert it with MCI2STR. It'd be like this:

    MenuCmd('DD', Patch + 'wu.sh summary ' + mci2str('UC'));

    You absolutely ROCK my friend! :)

    Works perfectly!!!

    You those who have this weather app (XQ-UWEATHER.ZIP), all you have to do
    is:
    modify wu.sh (Right under the apikey entry, modify state and city):
    state=$2
    city=$3

    and modify all the MenuCmd lines in xq-uweather.mps to add + mci2str('UC') Note the first MenuCmd line will change...
    From:
    MenuCmd('DD', Patch + 'wu.sh');
    To:
    MenuCmd('DD', Patch + 'wu.sh dummy ' + mci2str('UC'));

    The first part of the program doesn't use the first parameter...hence the
    'dummy'.

    Thanks again!
    Terry

    Of course this will only work if your account location is "state city".
    Meaning no comma or slash or any other variation. Probably could add a couple more lines of code to groom out any unwanted characters.

    Ok..last thing. In wu.sh, there is some condition logic (If/else statements) that check if the json data already exists or older than 7200 seconds (2 hours)...get rid of that logic to query/refresh every time the script is executed. Underground Weather
    API developers license is up to 10 times per minute...should be ok here. :)

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From g00r00@1:129/215 to Terry Rankin on Saturday, December 30, 2017 19:40:35
    You absolutely ROCK my friend! :)

    Works perfectly!!!

    Great! Glad to hear you have it working!

    --- Mystic BBS v1.12 A37 2017/12/30 (Windows/32)
    * Origin: Sector 7 [Mystic BBS WHQ] (1:129/215)