sosedoff / opentable

Unofficial OpenTable API
http://opentable.herokuapp.com/
Other
145 stars 39 forks source link

The zipcode is stripping leading zeros #8

Closed mclejar closed 9 years ago

mclejar commented 9 years ago

Hello,

In a recent update it seems that you have broken the zipcode field. Postal codes that start with 0 are missing the leading 0's. If we query agains postal code we get 0 results.

For example this restaurant in Boston has this for data:

{ "total_entries": 1, "per_page": 25, "current_page": 1, "restaurants": [ { "id": 106855, "name": "Nebo", "address": "520 Atlantic Ave", "city": "Boston", "state": "MA", "area": "Boston / New England", "postal_code": "2210", "country": "US", "phone": "6177236326", "lat": 42.353772, "lng": -71.053364, "price": 2, "reserve_url": "http://www.opentable.com/single.aspx?rid=106855", "mobile_reserve_url": "http://mobile.opentable.com/opentable/?restId=106855", "image_url": "https://www.opentable.com/img/restimages/106855.jpg" } ] }

You can see that the postal_code is "2210" when it should be "02210"

Therefore the following query returns 0 results:

https://opentable.herokuapp.com/api/restaurants?name=Nebo&address=520%20Atlantic%20Ave&city=Boston&state=MA&zip=02210

If we take off the zip param it works, but we have code that contains the zip right now.

Thanks!

sosedoff commented 9 years ago

Fixed.

sosedoff commented 9 years ago

There was an issue with XLS->CSV conversion, nothing to do with code.

mclejar commented 9 years ago

Thanks! Figured it was something like that. Actually one of the guys here called that exactly.