Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michael-spengler/location
🦕 Module to get Location Data - e.g. for IP Adresses or for Cities e.g. on earth 🌍 or on mars 🚀👩🚀👯♀️🛰🌌
https://github.com/michael-spengler/location
geolocation iplocation
Last synced: 26 days ago
JSON representation
🦕 Module to get Location Data - e.g. for IP Adresses or for Cities e.g. on earth 🌍 or on mars 🚀👩🚀👯♀️🛰🌌
- Host: GitHub
- URL: https://github.com/michael-spengler/location
- Owner: michael-spengler
- Created: 2020-07-02T18:12:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-28T17:00:31.000Z (10 months ago)
- Last Synced: 2024-09-16T16:08:19.557Z (about 2 months ago)
- Topics: geolocation, iplocation
- Language: TypeScript
- Homepage:
- Size: 17.6 KB
- Stars: 10
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Location Module
## Usage example for your code
```
import { IPLocationService } from "https://deno.land/x/location/iplocationservice.ts"
import { CityLocationService } from "https://deno.land/x/location/citylocationservice.ts"const ip = '49.12.6.159'
const ipLocation = await IPLocationService.getIPLocation(ip)console.log(`\nI found the following location for ip ${ip}: \n${JSON.stringify(ipLocation)}\n`)
const countryCode = 'DE'
const cityName = 'Heidelberg'
const cityLocation = await CityLocationService.getCityLocation(countryCode, cityName)console.log(`The city you asked for is about here: \n${JSON.stringify(cityLocation)}\n`)
```
## Test it via command line
```
deno run --allow-net --allow-read https://deno.land/x/location/usage-examples.ts
```
## Get 3 Words representation of Latitude and Longitude
```sh
deno run --allow-net https://deno.land/x/location/get-three-words-location.ts yourW3WAPIKey
```
## Contributions are welcome
Feel free to create a pull request if you would like to improve things.
## Donations
Thanks to [Freedom Cash](https://FreedomCash.org), we are already free.
If you want to donate, you might consider donating to the [otherparty.co.uk](https://www.otherparty.co.uk/donate-crypto-the-other-party) to ensure people do not need to donate to victims but rather donate successfully to problem solvers.
![direct-democracy](https://github.com/michael-spengler/sleep/assets/145258627/fe97b7da-62b4-4cf6-9be0-7b03b2f3095a)