Location on Desktop or Laptop

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
hrcap
Posts: 141
Joined: Mon Jan 14, 2019 5:20 pm

Location on Desktop or Laptop

Post by hrcap » Thu Jun 04, 2020 5:59 pm

Hi All,

I hope that everyone is well.

I have managed to get the mobilesensors to work to get the location of a user using a mobile device.

Is it possible to get the location of a user who is using a desktop or a laptop? For example when using the map widget the map seems to be able to automatically detect my location.


Many Thanks

Hadleigh

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Location on Desktop or Laptop

Post by richmond62 » Fri Jun 05, 2020 8:01 pm

I assume to get someone's location one would have to work out something to do with their MAC address and their ISP.

Or tap into what Google knows about them.

To my mind this raises a few odd thoughts about whether this is not intruding on someone's privacy.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10049
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Location on Desktop or Laptop

Post by FourthWorld » Fri Jun 05, 2020 8:51 pm

The shell function may do the trick, provided you have access to the 'net:
https://www.howtogeek.com/405088/how-to ... sh-script/
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

mrcoollion
Posts: 738
Joined: Thu Sep 11, 2014 1:49 pm

Re: Location on Desktop or Laptop

Post by mrcoollion » Sat Jun 06, 2020 9:39 am

You Could use an API from one of the following providers.
Not all of them give the best result but just try.
Most of them are paid services above a number of free calls per month.
For a list (but not all) see: https://rapidapi.com/blog/ip-geolocation-api/
The best result I got was from https://ipdata.co/
But there are many more....
Maybe you could also try to use an existing website and get the info from the return webpage ? https://www.iplocation.net/ip-lookup?qu ... ##.###.### where ###.###.###.### is the internet IP adres.

Just some idea's,

Regards,

Paul

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Location on Desktop or Laptop

Post by richmond62 » Fri Jun 12, 2020 3:50 pm

This might be worth a look:

https://en.ipip.net/

Post Reply