Does the use of place parameter in queries using the Facebook Graph API affect the results of post searches? - facebook

I 've been trying to test the place parameter when used for searching post using the Facebook Graph API. However it does not seem to affect results !!
For example:
https://graph.facebook.com/search?q=coffee&type=post&center=44,55&distance=1000
in the previous URL results do not change when I change the values of latitude and longitude (44,55) or the radius (1000)
Am I doing something wrong ?

I think the "distance" and "center" parameters only work when you use the parameter "type=place".
e.g. The two links below return demonstrate this.
https://graph.facebook.com/search?q=coffee&type=place&center=44.270962,55.096039&distance=1000&access_token=[access_token]
https://graph.facebook.com/search?q=coffee&type=place&center=53.270962,-6.096039&distance=1000&access_token=[access_token]
Once you have all the places returned, you could then do a further search on each place for their posts that contain coffee...

Related

How to pass fuzzyMatch param to mapbox geocoding api

I am using MapboxAPI for geocoding but I am experiencing it is tending to approximate location to city center when it can not match exact location.
Per documentation there is fuzzyMatch(Boolean true:default) option that can change this behavior.
Since I am using MapboxAPI directly through URL I tried following but all of them are returning same result set.
/geocoding/v5/mapbox.places/[url_encoded_address_text].json?fuzzyMatch=true&access_token=pk.abc...
/geocoding/v5/mapbox.places/[url_encoded_address_text].json?fuzzyMatch=false&access_token=pk.abc...
/geocoding/v5/mapbox.places/[url_encoded_address_text].json?fuzzyMatch=1&access_token=pk.abc...
/geocoding/v5/mapbox.places/[url_encoded_address_text].json?fuzzyMatch=0&access_token=pk.abc...
Looks like fuzzyMatch option does not do anything.
Is there something I am doing wrong?
You are using it correctly with the true/false params (docs):
/geocoding/v5/mapbox.places/[url_encoded_address_text].json?fuzzyMatch=true&access_token=pk.abc...
/geocoding/v5/mapbox.places/[url_encoded_address_text].json?fuzzyMatch=false&access_token=pk.abc...
Using the example from the docs, a query using types=place of wahsington and the fuzzyMatch=true param yields "place_name": "Washington, District of Columbia, United States" while using fuzzyMatch=false yields no results.
False - https://api.mapbox.com/geocoding/v5/mapbox.places/wahsington.json?access_token=pk.abc...&fuzzyMatch=false&types=place
True - https://api.mapbox.com/geocoding/v5/mapbox.places/wahsington.json?access_token=pk.abc...&fuzzyMatch=true&types=place

Extract text from a Wordnik API URL in Google Sheets

Can anyone explain how to import/extract a particular field from the following url into Google Sheets:
Wordnik URL
I'm guessing there is an IMPORTXML query that could do it, but it doesn't have the nodes that IMPORTXML usually uses to import that. Instead the code looks like this:
[{"mi":6.720745180909532,"gram1":"pretty","gram2":"much","wlmi":18.953166108085608},{"mi":6.650496643050408,"gram1":"pretty","gram2":"good","wlmi":18.469078820531266},{"mi":9.839004198061549,"gram1":"pretty","gram2":"darn","wlmi":17.298435816698845},{"mi":7.515791105774376,"gram1":"pretty","gram2":"cool","wlmi":15.515791105774376},{"mi":8.233704272151307,"gram1":"pretty","gram2":"impressive","wlmi":15.210984195651225}]
So if Cell A2 has the URL that produces this as the code, how do I get B2 to give me the text after "gram2" (in this case, "good", "darn", "cool" and "impressive").
Thanks
Tardy
I've come up with a workaround but it is kind of messy. I'd still like an answer to the question, but for reference and in case it's of use to anyone I'll post it here:
Using =IMPORTDATA(E10) (where E10 is the cell with the URL in) gave me an array (I guess based on .csv principles) that I could then manipulate using some other tools, like regexreplace, to get at the relevant bits of text.

Twitter advanced search by date AND location for research purposes

I'm trying to research a topic and I need to get all tweets within 2013 and 2015 and a specific location for two keywords.
I tried to get the results via Advanced Search but I allways get no results.
I tried:
cannabis near:"EspaƱa" within:15mi since:2013-10-07 until:2015-01-01
cannabis near:"Spain" within:15mi since:2013-10-07 until:2015-01-01
Basically, I have a database of scraped press articles sorted by date from a bunch of sources, and I want to know how the agenda of this news sources have an impact on the social media conversation.
I could do it over Reddit if it was the case for the US, but there's no Spanish alternative (well, we have Meneame, but the user base is very left-leaning and I think it will be very narrow).
So I wanted to either scrape the search results or get them via API, but It's not working, and AFAIK I can't do anything similar with Facebook.
One way to achieve this is by using Twitter's geocode operator. In the example below i took Madrid as a center and covered a radius of 600km around it like this:
(canabis OR cannabis) geocode:40.4381311,-3.8196196,600km since:2013-10-07 until:2015-12-31
Try it...
The syntax is as follows:
([your_boolean_search_query]) geocode:[latitude],[longitude],[radius]km since:[] until:[]
one easy way to find latitudes and longitudes of locations is to use Google Maps. Simply navigate to a place using the search box and then copy the latitude and longitude element from the URL line in the browser. Here it is for Madrid. The latitude and longitude are right after the # sign, separated by a comma:
https://www.google.com/maps/place/Madrid,+Spain/#40.4381311,-3.8196196,54451m/data=!3m2!1e3!4b1!4m5!3m4!1s0xd422997800a3c81:0xc436dec1618c2269!8m2!3d40.4167754!4d-3.7037902?hl=en
Try it...

Facebook graph api where location equals

I'm trying to search pages which location city equals to xyz.
For example find page Guiness in city = Wroclaw, it looks like this:
/search?q=Guiness&type=page&city=Wroclaw
But it doesn't work ?!
I tried many different ways.
I think the problem is in that the location is complex type, but I can't find in documentation how to search by complex type :(.
Hope help will came soon.
Thanks !
It's clearly documented what is possible with the /search endpoint:
https://developers.facebook.com/docs/graph-api/using-graph-api/v2.5#search
You can't use other parameters than outlined there. Either this would be
/search?q=Guiness%20Wroclaw&type=page&fields=id,name,location
or search for a place with center coordinate and a distance:
/search?q=Guiness&type=place&center=52.231804,21.007973&distance=5000

Keyword search in facebook graph api

I am searching the facebook status which contains the specific keywords as follows.
https://graph.facebook.com/search?q=test&date_format=U&limit=60
&access_token={MY_ACCESS_TOKEN}
the above query returns the result correctly,
But when i search the keyword contains the space (ex: graph api). It doesn't returns the status which contains the keyword "graph api".
It returns the results of the keyword search graph and api seperately.
Is there any possible way to search the keywords which contains the space?
Update:
Methods which have been tried by me:
https://graph.facebook.com/search?q=facebook+search&date_format=U&
limit=60&access_token={{MY_ACCESS_TOKEN}}
https://graph.facebook.com/search?q=facebook%20search&date_format=U&
limit=60&access_token={{MY_ACCESS_TOKEN}}
https://graph.facebook.com/search?q=facebook%20Bsearch&date_format=U&
limit=60&access_token={{MY_ACCESS_TOKEN}}
https://graph.facebook.com/search?q="facebook search"&date_format=U&
limit=60& access_token={{MY_ACCESS_TOKEN}}
the above all gave the same result.
What you might want to try is taking your query and performing a URL encode on it. You can try these two options -
https://graph.facebook.com/search?q=graph+api&date_format=U&limit=60
&access_token={MY_ACCESS_TOKEN}
https://graph.facebook.com/search?q=graph%20api&date_format=U&limit=60
&access_token={MY_ACCESS_TOKEN}
These two options attempt to encode the space character in the query first with a + character, and then with %20. I'm fairly sure that one (or both) of these options will provide the results you are looking for.