How can I create a Facebook event in Graph API setting latitude and longitude?
I have tried the Graph API Explorer, using a post method to https://graph.facebook.com/MY_ID/events and parameters.
All works fine, except for latitude and longitude. I also have tried to create a local page with a valid location and set the page_id/location in event's parameters, but that only creates the event assigned to the page.
What is the solution?
The latitude and longitude are part of the Venue data on an event, but when you create the event, they need to be top level parameters.. Once the event is created and you query for it using the /{eventid} query, they will show up in the Venue JSON node.
I have been experiencing the same problem and have found no method of posting event data that results in saving latitude and longitude. What I have discovered is that after an Event is created editing the event - even with no changes - results in a calculation of the latitude and longitude. The resulting calculated values are slightly different than those passed in the post so these values are clearly not related the parameters I passed.
Related
In the V2 api, is there a way to partially update a catalog object? For example, if I have an item, and I don't want to keep track of modifier_list_info, it seems I have to send that data with any upserts otherwise it will get wiped out.
Is there a way to specifiy a partial update?
The best way to update a catalog object would be to first retrieve the object (https://docs.connect.squareup.com/api/connect/v2#endpoint-retrievecatalogobject), and then edit the properties you need to change. For instance, the response will have an object field so
response.object.item_data.name = 'Food'
will change the name to 'Food'. Then pass the entire object back to the UpsertCatalogObject endpoint. This will keep all the same properties except for changing the name.
I have a form in laravel where there is google's autocomplete field named as address. There is no map and stores address as New Road, Kathmandu, Nepal.
I need to obtain its geo coordinates(lat lng) in controller before storing to database. So that I could calculate radius from it and provide information to users about near people.
You can do it when you fill address fields on the form. Following is the code to fill longitude and latitude. And then post the form and calculate radius in your controller.
$('#latitude').val(place.geometry.location.lat());
$('#longitude').val(place.geometry.location.lng());
I'm fairly new to RethinkDB and am trying to solve a thorny problem.
I have a database that currently consists of two kinds of account, customers and technicians. I want to write a query that will produce a table of technicians, ordered by their distance to a given customer. The technician and customer accounts each have coordinate location attributes, and the technicians have a service area attribute in the form of a roughly circular polygon of coordinates.
For example, a query that returns a table of technicians whose service area overlaps the location of a given customer looks like this:
r.db('database').table('Account')
.filter(r.row('location')('coverage').intersects(r.db('database')
.table('Account').get("6aab8bbc-a49f-4a9d-80cc-88c95d0bae8d")
.getField('location').getField('point')))
From here I want to order the resulting subtable of technicians by their distance to the customer they're overlapping.
It's hard to work on this without a sample dataset so I can play around. I'm using my imagination.
Your Account table stores both of customer and technician
Technician document has field location.coverage
By using intersect, you can returns a list of technician who the coverage locations includes customer location.
To order it, we can pass a function into orderBy command. With each of technican, we get their point field using distance command, return that distance number, and using that to order.
r.db('database').table('Account')
.filter(
r.row('location')('coverage')
.intersects(
r.db('database').table('Account').get("6aab8bbc-a49f-4a9d-80cc-88c95d0bae8d")('location')('point')
)
)
.orderBy(function(technician) {
return technician('location')('point')
.distance(r.db('database').table('Account').get("6aab8bbc-a49f-4a9d-80cc-88c95d0bae8d")('location')('point'))
})
I hope it helps. If not, let's post some sample data here and we can try figure it out together.
I'm creating an app in Titanium that uses the Facebook Graph API to get all the users events, however, the venue information, it only brought to me, after I was very specific about the field, and some times, a lot of the times, when the Event was created in a known location, it only brings the venue_id, and when I query the venue(via http://graph.facebook.com), then it gives me the venue location details, more importantly, the latitude and longitude of the thing.
Is it possible to bring the information of the venue in the same response?
Also, it only brings the events that the user is attending, is there any way to show the events recommended to him also?
Ti.Facebook.requestWithGraphPath('me/events?limit=5000&fields=id,owner,name,description,start_time,end_time,location,venue,privacy,updated_time', {}, 'GET', function(e) {
obj = JSON.parse(e.result);
Ti.API.info('Events: '+JSON.stringify(obj));
}}); // Facebook Events
Also, it only brings the events that the user is attending, is there any way to show the events recommended to him also?
Not sure what exactly you mean by “recommended” … if you mean events the user has been invited to, then you can query the FQL event_member table with the user id.
You can kind of “join” the info from the table above with the event table by selecting from that using WHERE eid IN (SELECT … FROM event_member WHERE …)
Is it possible to bring the information of the venue in the same response?
Using a multi-query you can do it, similar to as it is described here: FQL: query for event table returns venue.name instead of venue.id
I am able to fetch user event but i require to fetch event using location wise like event in usa , uk , india.
How can fetch event location or b/w date range in Facebook
Way #1: Graph API using the event object From: http://developers.facebook.com/docs/reference/api/event/
When you call the graph API using https://graph.facebook.com/{EventId}?fields=location you should get back a location if it was specified by the event admin. You can then try to see if that location is in the area you're looking for. If not, then move onto the next one.
Way #2: Graph API using the event fql table From: http://developers.facebook.com/docs/reference/fql/event/
When you call the graph API using https://graph.facebook.com/fql?q=SELECT name, location FROM event WHERE eid={EventId} you will also get back the event and location. If you want to be tricky and get a listing of all events for an authenticated user, then you can do FQL such as SELECT name, location FROM event WHERE eid IN (SELECT eid FROM event_member WHERE uid=me())