• Getting IP Address

    From Mortifis@VERT/EMPTYKEG to All on Mon Jan 21 15:45:03 2019
    In the /web/root/index.ssjs I would like to grab the connecting user's IPãaddress and pass it along to a system.open("script ip_add") as an argv but Iãcannot figure out exactly how to obtain that value, I know as an @-code it isã@@IP@ but that doesn't seem to equate in js.ãã---ã þ Synchronet þ The Empty Keg BBS emptykeg.synchro.net:82 Lake Echo NS Canadaã
  • From echicken@VERT/ECBBS to Mortifis on Mon Jan 21 15:24:32 2019
    Re: Getting IP Addressã By: Mortifis to All on Mon Jan 21 2019 15:45:03ãã Mo> In the /web/root/index.ssjs I would like to grab the connecting user's IPããYou can get it from http_request.remote_ip or client.ip_address, and theseãprobably have the same value.ãã Mo> address and pass it along to a system.open("script ip_add") as an argv butããsystem.exec('/path/to/script ' + http_request.remote_ip);ãã---ãechickenãelectronic chicken bbs - bbs.electronicchicken.com - 416-425-5435ã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã
  • From Mortifis@VERT/EMPTYKEG to echicken on Mon Jan 21 17:06:04 2019
    Re: Getting IP Addressã > By: Mortifis to All on Mon Jan 21 2019 15:45:03ãã > Mo> In the /web/root/index.ssjs I would like to grab the connecting user'sã > Mo> IPãã > You can get it from http_request.remote_ip or client.ip_address, and theseã > probably have the same value.ãã > Mo> address and pass it along to a system.open("script ip_add") as an argvã > Mo> butãã > system.exec('/path/to/script ' + http_request.remote_ip);ããPerfect, Thank You! ... in /sbbs/web/root/index.ssjs I used template.weather =ãsystem.popen("weather" + http_request.remote_ip); (Sorry, still using the stockãNightshade Theme) then in /sbbs/web/templates/nightshade/rightnav.ini I addedã@@weather@@ ... weather is a php script (cuz I suck at js) to grab theãopenweathermap after parsing the city via a file_get_contents fromãapi.ipstack.com ... probably an easier way to do it but it worksããPerhaps you could give it a little test later and see if it gets your weatherãhttp://emptykeg.synchro.netãã---ã þ Synchronet þ The Empty Keg BBS emptykeg.synchro.net:82 Lake Echo NS Canadaã