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ã
Sysop: | Karloch |
---|---|
Location: | Madrid, Spain |
Users: | 78 |
Nodes: | 8 (0 / 8) |
Uptime: | 175:01:20 |
Calls: | 1,376 |
Calls today: | 2 |
Files: | 17,895 |
D/L today: |
137 files (61,202K bytes) |
Messages: | 66,504 |