-
Notifications
You must be signed in to change notification settings - Fork 33
Request for location-based API #245
Comments
Great idea @kahwee! I like cc: @cheeaun @subhransu what do you guys think? https://twitter.com/webuildsg/status/743680320549978113 |
I'm also wondering if the return |
yes |
Probably need one more Good reference from Foursquare: https://developer.foursquare.com/docs/venues/search - also have boundary limit ( |
cool so it's |
Huh wait, the |
uh i rather have one word E.g. |
Example return query {
meta: {
generated_at: "2016-06-20T05:01:15.432Z",
location: "Singapore",
api_version: "v1",
total_events: 3
},
events: [
{
id: "231387009",
name: "Singapore MusicTech - June Meetup",
description: "blah...",
location: "PayPal 7th Floor, 5 Temasek Blvd, #07-01 Suntec Tower Five, Singapore",
rsvp_count: 74,
url: "http://www.meetup.com/Singapore-MusicTech-Meetup/events/231387009/",
group_id: 19993868,
group_name: "Singapore MusicTech Meetup",
group_url: "http://meetup.com/Singapore-MusicTech-Meetup",
formatted_time: "20 Jun 2016, Mon, 7:00 pm",
start_time: "2016-06-20T11:00:00.000Z",
end_time: "2016-06-20T13:00:00.000Z",
latitude: 1.294414,
longitude: 103.858093,
radius: 3
}
]
} |
Why are we trying to do this on the server side? This can be easily done in a client? |
actually agree with @notthetup. Once we have the latitude and longitude in the initial JSON. We can compute it on the client. Will save us with one more server request. |
Can also, tho' the accurate way, considering radius of Earth, would be the Haversine formula or use |
@notthetup trying to provide an api for 3 clients to do this easily? Yes, agreed about performance and server query time 🤔 |
@cheeaun nice! so we can use that tiny function on the client side. Can we only support SI Units? 😝 |
I think client side processing of If the server can handle this, it makes the output of the iOS, Android and, potentially, Facebook Chat bot much more consistent. 😄 |
@kahwee Alright, we can create the API endpoints. We will leave it to the individual client (iOS / Android / chat bots) developers on how they would want to create the relative |
The question is should we create it here or in the repo https://github.com/webuildorg/webuild-events. I'm fine with |
I still don't see why the server should do the filtering by lat/long/distance/radius. Especially when all the information needed is available in the API. We are increasing complexity in server for something that can be easily done on the client. Clients of today are performant enough to be able to do such calculations IMO ( I have no metrics on this, but this is my gut feeling). Also, the size of data we are retrieving is small (if you query the /day end point), and I don't expect it to go to tens of thousands of items size anytime soon, at which point I feel doing it on server side might have performance benefits. Finally, on consistency, I see why that makes sense, but since all the apps are not made by the same person, or the same group, we are not really going to have similar UX across the apps anyway. So consistency isn't really we are aiming for. I fear not all clients may even use this new API endpoint. |
@kahwee - let's try to implement this on the client side first for the Facebook chat bot https://github.com/webuildsg/bot? See how it works and then we can make a decision |
@notthetup, it goes back to what the We Build SG API is intending to serve. My hope is to make it easier for implementer. If you do not want this to be in the main server at all, I can implement this on the chat server instead of a common server. You are simply suggesting pushing the complexity a layer up to the chat server. There's no right or wrong in this case, either servers requires the same amount of work to be done. @sayanee Sure. |
Hello!
I wanted to match events and have it be sorted by distance.
The API could be something like:
Suggested cases:
lat
XORlng
, return error.lat
ANDlng
, use that as point of origin to compute the distance.The return format should be sorted by
distance
which is revealed as an additional key in the itemized array ofevents
received.What do you think?
The text was updated successfully, but these errors were encountered: