GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Accessing Timezone webservice  XML
Forum Index -> General
Author Message
cswimvguy



Joined: 26/02/2011 18:01:23
Messages: 2
Offline

Can someone please tell me what I'm doing wrong? I'm using cURL to access the Timezone webservice api. This is the url that I am submitting;

http://api.geonames.org/timezone?lat= 42.6650350&lng=-88.2865610&username=[username]

and this is what I get back;

<status message="Please add a username to each call in order for geonames to be able to identify the calling application and count the credits usage." value="10"/>

It appears to be break on the & and ignore the last input parameter because if I specify the username first than I get;
http://www.mvcommunitymap.com http://api.geonames.org/timezone?username=[username]&lat=43.1026690&lng=-89.3504270

status message="missing lat/lng" value="14"/>

Is this a bug or (more likely) what am I missing?

Thanks for any help you can give. I've been banging my head on this one for a day and I really like to use this service.

Thanks
cswimvguy
marc



Joined: 08/12/2005 07:39:47
Messages: 4501
Offline

you have a blank in front of the lat value (at least in the url you posted above). this causes the url to end there.

Marc

[WWW]
cswimvguy



Joined: 26/02/2011 18:01:23
Messages: 2
Offline

Thanks for the reply Marc, but that wasn't the issue. In one of my earlier attempts I noticed the space and added code to remove it. (Sorry I posted a link from one of my earlier attempts, for my first example).

If you notice in my second example, I didn't have any extra spaces after timezone?.

I did just figure it out though, it's an issue with Curl and the Bash shell that I'm using. The service works perfectly fine if I put my url request in quotes. That way the shell doesn't try to interpret them as separate commands (I think).

So here is the command that works with by bash shell;

!curl "http://api.geonames.org/timezone?username=[username]&lat=47.7006150&lng=-122.1786940"

Thanks again for the reply, I was pretty sure that it was something I was doing wrong...
cs
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team