Giter Club home page Giter Club logo

Comments (7)

kinotto avatar kinotto commented on September 16, 2024

Hello @Arlind-Prosperoware
the rest api is this one,

http://api.geonames.org/countryInfoJSON?formatted=true&lang=en&username=${YOUR_USERNAME}&style=full

replace ${YOUR_USERNAME} with your username, you will get the json response. If something is wrong in the payload you should contact geonames directly, they have a dedicated forum here:
http://forum.geonames.org/

from geonames.js.

Arlind-Prosperoware avatar Arlind-Prosperoware commented on September 16, 2024

Hi @kinotto , The issue seems to be resolved now. There are no more duplicate countries.
Thanks.

from geonames.js.

kinotto avatar kinotto commented on September 16, 2024

great @Arlind-Prosperoware :)

from geonames.js.

Arlind-Prosperoware avatar Arlind-Prosperoware commented on September 16, 2024

Hello @kinotto ,

When I'm using the example code to get all the countries this is the REST API that is being invoked:
https://secure.geonames.org/countryInfoJSON?username=prosperoware&lang=en and this API is returning duplicates.

The API that you mentioned is returning the correct format but its not the API thats being called by the code.

from geonames.js.

kinotto avatar kinotto commented on September 16, 2024

Hi @Arlind-Prosperoware ,
are you using the commercial tier? did you pass a token in the config object? try to avoid passing the token and see if you still get duplicates.

Anyways if you get duplicates you might ask directly in the geonames forum probably they can better address the problem and probably solve it :)

from geonames.js.

Arlind-Prosperoware avatar Arlind-Prosperoware commented on September 16, 2024

Im not sending the token at all and I'm not using the commercial tier.
This is my config:
{username: name, lan:'en', encoding:'JSON'}

https://secure.geonames.org/countryInfoJSON?username=username&lang=en
This API request is returning duplicates and is not returning all the data.

http://api.geonames.org/countryInfoJSON?formatted=true&lang=en&username=username&style=full
This API request is returning the correct data without duplicates

from geonames.js.

kinotto avatar kinotto commented on September 16, 2024

As i told you the payload of the response is not under my control, and i cannot filter the data in the library cause it wouldn't be the correct solution the purpose of this library is just to wrap their service into a js module.
When you say duplicates i don't know at which countries you're referring to because i cannot find them, but a part from that if there is a bug in the service it is correct to raise it in order to make them fix it :)

from geonames.js.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.