如何过滤公共帖子按特定语言或获取语言字段? [英] How filter public posts by specific language or get the language field?
问题描述
我试图以这种方式获得针对特定主题的公开帖子,例如Facebook API en法语(您需要更改以下access_token):
I'm trying to get the public posts for a specific subject with Facebook API en French for example (you need to change the access_token below) with this way :
这不工作。我在结果中有混合语言(西班牙语,法语,英语...)。我检查了Facebook开发人员网站,我找不到一个问题。有人有同样的问题吗?
This is not working. I have mixed languages (Spanish, French, English...) in the result. I checked the Facebook developers website and I cannot find a issue here. Somebody have the same problem?
事实上,如果在结果中,我有一个 lang
帖子,这将是对我好。我试图添加在 fields = languages
(和另一个词像 lang
,语言,
locale
...),但这不起作用。
In fact, if in the results, i have a lang
key associated to each post, this would be good to me. I tried to add in the url fields=languages
(and anothers words like lang
,language
,locale
...) but this is not working too.
您的帮助! (对不起我的英语)
Thank you for your help! (sorry for my English)
推荐答案
graph.facebook.com/search?q=cinema&type=post&locale=fr_FR
实际上,当运行此查询时, locale
参数 。它提供以法语翻译的类别。
In fact, when running this query, the locale
parameter is considered. It gives categories translated in French.
{
"id": "376665779074901_525847047490106",
"from": {
"category": "Site internet de détente/sports",
"name": "Hasil+jadwal+klasemen Sepakbola",
"id": "376665779074901"
},
"message": "Hasil Pertandingan\n\nLike (y) & Bagikan ...\n\n• England- Premier League\nFT Chelsea 2 - 0 Fulham\nGoals :\n52'[1 - 0] Oscar\n84'[2 - 0] John Obi Mikel\n-\nFT Liverpool 0 - 1 Southampton\nGoals :\n54'[0 - 1] Dejan Lovren\n-\nFT Newcastle United 2 - 3 Hull City\nGoals :\n10'[1...
}
但我必须同意,它不是真正有用的。至少你可以做的是,在用户发布的情况下,检查用户使用的语言是什么:
But I must agree, it's not really helpful. The least you could do would be, in the case of a user post, to check what is the language the user is using:
graph.facebook.com/USER_ID?field=locale
除此之外,我不得不说你不能依赖Facebook的区域信息。 Facebook不知道帖子是用法语还是英语写的。 ALso,有人用英语使用Facebook并不意味着他只会写英文的帖子。如果您想查找特定语言的所有邮件,请使用专用于 language识别。
Apart from that, I have to say that you can't rely on Facebook's locale information. Facebook doesn't know if a post has been written in French or English. ALso, someone using Facebook in English doesn't mean he will only write english posts. If you want to find all messages in a specific language, better check all messages by yourself with another web service dedicated to language recognition.
这篇关于如何过滤公共帖子按特定语言或获取语言字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!