I have a question about the Facebook Places API:
https://graph.facebook.com/v2.10/search?type=place
Does anyone know how to get the city name in a different language from Facebook?
If I use a locale in the request, then I still get the english version of the city in the location object:
e.g.
https://graph.facebook.com/v2.10/search?type=place&limit=10&fields=name,category_list,location,phone,website,city&locale=de_DE&q=Petersdom
city is always "Rome". But with the locale "de_DE" it should be "Rom".
Does anyone have experience with it?
thanks
Related
I am supporting an app that gets player game statistics. We have for example playstation or xbox nickname and need to find bungie membershipId.
I look code - we missuse "Destiny2/SearchDestinyPlayer" API, as it requires not playstation nickname (or xbox nickname) but full bungie name including #xxxx (# id)
https://bungie-net.github.io/#Destiny2.SearchDestinyPlayer
Looks like before in Destiny2 appeared cross-save function it was the same nickname and #id was not mandatory.
Could someone suggest another API that accepts platform (xbox or playstation) nickname?
Also maybe suggest forum dedicated to bungie API?
PS: I searched alternative sites, for example on "https://destinytracker.com/" I am able to select platform "Playstation" and enter nickname "T-rex_on_point" - it finds bungie name Brontosaurus881#6169 and also membershipId inside URL. How it does it? What API it uses?
I finally need "membershipId" id, but if I will find full bungie display name - then I am able to find "membershipId" with Destiny2/SearchDestinyPlayer" API mentioned above
There is no "Other API". All applications uses one API which's Bungie's.
I'm assuming you're making the request using # in the URL which's not UTF-8 URL encoded.
You'll need to encode the URL specifically the # which will be encoded to %23. So instead of making the request with this name Brontosaurus881#6169 it should be like this Brontosaurus881%236169.
Also what language are you using? if Python then use urllib.parse.quote("Brontosaurus881#6169").
If not then i suggest you looking up how to encode a URL in x language.
Also if you're using Python, There's a wrapper around the API that already does that for you if you're interested and using Python.
Hi I have problem with Facebook Graph API. I'm using it in cordova with this plugin: https://github.com/jeduan/cordova-plugin-facebook4 (I think is not important)
The main problem is value gender. When system language is English I get following value:
gender: "male"
but when my system language is Czech I get following value:
gender: "muž"
and this is problem for me because I expecting for future work "male" or "female"
does anyone now how to figure it out and get always english?
Thanks for any answer
You just have to add the locale to the API call, it would be like this for english:
/me?fields=gender&locale=en_US
Or with the Cordova plugin:
facebookConnectPlugin.api('/me?fields=gender&locale=en_US', ...)
See this for more information about how to use the Graph API.
Written under "Modifying API Requests":
locale
Used if your app needs the ability to retrieve localized content in the language of a particular locale (when available).
So try to set the locale parameter to english.
When using facebook connect with devise, I get the hometown like this:
... hometown=#<Hashie::Mash id="116045151742857" name="Munich, Germany">
locale="de_DE" ...
Is there a way to get each users hometown in his own locale or at least in one set locale (de_DE in my case), e.g. "München, Deutschland" with the facebook API?
I don't want to sport my own database of hometowns if I don't have to.
Note tested, but you could try adding &locale=de_DE to the graph call. You can get the locale from the user object so potentally could customise this per user. Do a "/me" graph call to get the locale, then do a "/me?locale=de_DE" to get it in the user's language.
As I've said, I've not tested so it may not change the content of the field (e.g. Germany -> Allemande) but worth a shot if you've not tried it.
we are working on a mobile app that accesses facebook user data.
We want to get the users activities, interests and favorite books, music, etc. We are fetching these information via the Graph API but now we are facing the problem, that the returned interests are in english language.
That are the steps we are taking to fetch common interests:
1) Get access token
2) Call https: //graph.facebook.com/me/interests&access_token=XXX0&locale=de_DE
The response is somewhat like:
{"data":[{"name":"Programming","category":"Interesse","id":"101882226520576","created_time":"2011-08-02T08:38:03+0000"}]}
You can see, that the category is tanslated, but we are also looking for the german version of the name field ("Programmierung").
When i try to access the english "Programming"-page on http://www.facebook.com/pages/Programming/101882226520576 i am forwarded to http://www.facebook.com/pages/Programmieren/106375099398136.
Accessing 106375099398136 with Graph API yields the correct response:
{
"id": "106375099398136",
"name": "Programmieren",
"link": "http://www.facebook.com/pages/Programmieren/106375099398136",
"likes": 6983,
...
}
How do i get this locale dependent link between "Programming"-page and "Programmierung"-page via the Graph API?
just want to share a possible workaround for the above problem.
Basically we are emulating what is happening when the user trys to access a facebook page and is redirected to the localized counterpart. So we are sending a HTTP request to "facebook.com/pages/PAGE_ID" with the user locale set in the HTTP header and follow the redirects until the last location. The URL of the last location is somewhat like "http://www.facebook.com/pages/LOCALIZED_PAGE_NAME/PAGE_ID" and we are extracting the page name from this.
This is an effective but far from efficient solution :) Would appreciate a more elegant way to handle this.
Bye,
Tobias
In my iphone application i have integrated Google Map.I want to show the country location on Google map using only country Name Only.(Not needed to use its latitude and longitude).The input only will be the country name?(i.e India) to the google Map and Map will locate it with indicate pinpoint.
Is it possible to locate the country using the country name in google Map?
Is any body has any solutuion or code snippet or any useful link,which would be appreciated.
Thanks,
Mishal Shah
There is no geocoder in the iPhone SDK at this time. You'll have to use a library likes http://developers.cloudmade.com/wiki/iphone-api/Geocoding_iPhone_example or call Google geocoder API, Yahoo etc.