catamphetamine / libphonenumber-js

A simpler (and smaller) rewrite of Google Android's libphonenumber library in javascript
https://catamphetamine.gitlab.io/libphonenumber-js/
MIT License
2.77k stars 218 forks source link

Question: is it possible to get geolocation out of a number, using this library? #398

Closed AndroidDeveloperLB closed 3 years ago

AndroidDeveloperLB commented 3 years ago

So far I've seen only this library offering it (for free): https://mvnrepository.com/artifact/com.googlecode.libphonenumber/geocoder Demo: https://libphonenumber.appspot.com/

There are some online services too, like these : https://www.allareacodes.com/area-code-lookup/ https://www.ipqualityscore.com/phone-number-validator

I've found some libraries that might have it, but they are quite old. Newest one I've found is this: https://github.com/BlueRival/node-areacodes

But I don't see on the demo here that it's possible.

catamphetamine commented 3 years ago

Hi. If something like that was a feature, it would have to be a separate library, because otherwise (hypothetically) the metadata would be larger, and people already complain about the bundle size.

AndroidDeveloperLB commented 3 years ago

@catamphetamine I guess... Google does it too, as a "bonus", optional library, to the original one. Is it a hard thing to do? Where do you get the data from? Where does Google get the data from? Where would this kind of information (the geolocation) would be from? Can you please consider adding such a library?

catamphetamine commented 3 years ago

Where do you get the data from?

If you meant phone number metadata, then it's that file: https://github.com/google/libphonenumber/blob/master/resources/PhoneNumberMetadata.xml

Where does Google get the data from?

Where would this kind of information (the geolocation) would be from?

You could ask them.

Can you please consider adding such a library?

Do it yourself.

AndroidDeveloperLB commented 3 years ago

OK thanks and sorry if this made you upset.

catamphetamine commented 3 years ago

sorry if this made you upset.

It surely didn't.

AndroidDeveloperLB commented 3 years ago

OK have a nice day :)

catamphetamine commented 3 years ago

Hmm, you too )