mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
collect pagetitle, update subdivision2 data type
This commit is contained in:
parent
55a586fe27
commit
6c302a7325
8 changed files with 3511 additions and 12 deletions
|
|
@ -6,12 +6,12 @@ const maxmind = require('maxmind');
|
|||
|
||||
async function getLocation() {
|
||||
const lookup = await maxmind.open(path.resolve('../node_modules/.geo/GeoLite2-City.mmdb'));
|
||||
const result = lookup.get('104.93.28.0');
|
||||
const result = lookup.get('46.135.3.1');
|
||||
|
||||
const country = result?.country?.iso_code ?? result?.registered_country?.iso_code;
|
||||
const subdivision = result?.subdivisions[0].iso_code;
|
||||
const subdivision2 = result?.subdivisions[0].names;
|
||||
const subdivision3 = result?.subdivisions[1].names;
|
||||
const subdivision = result?.subdivisions[0]?.iso_code;
|
||||
const subdivision2 = result?.subdivisions[0]?.names?.en;
|
||||
const subdivision3 = result?.subdivisions[1]?.names?.en;
|
||||
const city = result?.city?.names?.en;
|
||||
console.log(result);
|
||||
console.log(country, subdivision, city, subdivision2, subdivision3);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue