我试图根据 Facebook 用户喜欢的页面等来了解他们的兴趣。拥有可能的页面类别列表会很有用。我根据页面创建表单中的下拉菜单制作了一个粗略列表,但其中的值与 Graph API 返回的值略有不同(例如“Sports_teams”而不是“Sports team”)。
所以,我想知道的是:
- 在哪里可以找到可用类别的完整列表,其形式是我在查询 Graph API 时看到的?
- 这些字符串是否已本地化?如果是这样,我在哪里可以找到 en_GB 的?
预先感谢您的帮助。
顺便说一句,罗斯
,我的类别列表是:
19,Band
19,Musician
68,Restaurant
88,Film
89,TV Programme
91,Technology product/service
92,Financial Service
94,Fashion
108,Museum/attraction
109,Park
110,Travel
111,Hotel/B&B/Hostel
112,Hotel/B&B/Hostel
113,Travel service
114,Airline/Ship/Train Station
115,Convention or sports centre
116,Car Hire
117,Home living
121,Café
123,Health and beauty
124,Education
125,Event planning service
126,Banking and financial service
127,Technology and telecommunications service
129,Medical service
130,Home service
131,Car Dealer/Vehicle Service
132,Local business
133,Pharmaceutical
134,Pets
135,Professional service
136,Professional service
137,Property
138,Food & drink
139,Supermarket
140,Automotive
141,Consumer product
142,Sports/athletics
143,Retail
144,Shop
145,Online shop
147,Religious organisation
148,Religious centre
149,Library/Public Building
150,Government
151,Politician
152,Non-profit
154,Game
156,Sports team
157,Actor
158,Model
159,Comedian
160,Visual artist
161,Writer
162,Critic
163,Public figure
164,Club
165,Pub/bar
167,Website
169,Athlete
170,Communications
176,Products
349,Government Official
I'm trying to find out about a Facebook user's interests based on pages they like, etc. It would be useful to have the list of possible page categories. I have made a rough list based on the dropdown menus from the page creation form, but the values in this are slightly different to those returned by the Graph API (e.g. "Sports_teams" as opposed to "Sports team").
So, what I'd like to know is:
- Where can I find a complete list of available categories, in the form that I'll see them when I query the Graph API?
- Are these strings localised? If so, where can I find the en_GB ones?
Thanks in advance for your help.
Ross
BTW, my list of categories is:
19,Band
19,Musician
68,Restaurant
88,Film
89,TV Programme
91,Technology product/service
92,Financial Service
94,Fashion
108,Museum/attraction
109,Park
110,Travel
111,Hotel/B&B/Hostel
112,Hotel/B&B/Hostel
113,Travel service
114,Airline/Ship/Train Station
115,Convention or sports centre
116,Car Hire
117,Home living
121,Café
123,Health and beauty
124,Education
125,Event planning service
126,Banking and financial service
127,Technology and telecommunications service
129,Medical service
130,Home service
131,Car Dealer/Vehicle Service
132,Local business
133,Pharmaceutical
134,Pets
135,Professional service
136,Professional service
137,Property
138,Food & drink
139,Supermarket
140,Automotive
141,Consumer product
142,Sports/athletics
143,Retail
144,Shop
145,Online shop
147,Religious organisation
148,Religious centre
149,Library/Public Building
150,Government
151,Politician
152,Non-profit
154,Game
156,Sports team
157,Actor
158,Model
159,Comedian
160,Visual artist
161,Writer
162,Critic
163,Public figure
164,Club
165,Pub/bar
167,Website
169,Athlete
170,Communications
176,Products
349,Government Official
发布评论
评论(12)
我必须提取所有类别并放置主题,但我发现使用此线程中提供的解决方案提取它们时出现问题。 @not_this_again 在他的 回复 中的查询没有返回地点主题的完整列表,我不知道为什么。
我发现 Facebook 返回类别并将主题放置在 category_list 属性中“nofollow noreferrer”>页面。因此,我提取了大约 40 万个地点并处理了它们的类别列表,以获得尽可能多的结果。结果于 2017 年 10 月 20 日获得。
我希望它能有所帮助,Xavi
204 个类别:
和 1201 个地方主题,可在此 要点(除了类别之外)。
I had to extract all categories and place topics, but I found problems extracting them using the solutions provided in this thread. The query of @not_this_again does in his reply does not return a complete list of place topics, I don't know why.
I found that Facebook returns categories as well as place topics in the
category_list
attribute of pages. Therefore, I extracted about 400k places and processed their category list to get as much results as I could. The results were obtained the 20th of October 2017.I hope it helps, Xavi
204 categories:
and 1201 place topics that are available in this gist (besides categories, too).
我花时间记录了一个脚本,该脚本可以以 JSON 格式获取上述数据。对于任何感兴趣的人,请查看此要点。截至 2012 年 3 月 23 日,我获得的类别列表是:
I took the time to document a script that can grab the above data in JSON format. For anyone interested, check out this gist. The list of categories that I got as of March 23, 2012 is:
我使用 Facebook 的搜索 API 随机收集了 105,000 个页面样本,得到了 197 个页面类别,远远多于“创建页面”网页上显示的 147 个类别。这是列表:
如果您想知道,这是我使用的代码(python):
基本上执行一堆随机的 2 个字符长的查询并收集结果页面。有用!
I gathered a random sample of 105k pages using Facebook's search api and got 197 page categories, way more than the 147 that appear on the "create page" webpage. This is the list:
In case you're wondering, this is the code I used (python):
Basically perform a bunch of random 2 character long queries and gather the resulting pages. It works!
截至 2014 年 12 月,我得到了以下带有搜索 API 的列表(Graph API 版本 v2.2)
https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#search
As of Dec-2014 i got the following list with search API (Graph API version v2.2)
https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#search
这应该是完整的列表,如上所述进行逆向工程:
this should be the complete list, reverse engineered as mentioned above:
截至 2014 年 6 月 3 日,API v2.0 共有 150 个类别。您应该注意,这些只是页面的主要类别。每个 Facebook 页面都有一个
category_list 数组字段,其中包含此处未显示的子类别。您可以通过以下查询通过图形 API 获取地点的所有子类别列表:
search?type=place_topic&topic_filter=all
仅供参考,因为 Facebook 一直在变化,这是最简单的方法获取列表的方法是按照@RichSutton的建议进行操作,然后转到创建页面页面,然后检查下拉列表中的元素。 5-6 复制粘贴,一个正则表达式之后你就得到了完整的列表(有一些重复的)。
150 categories as of June 3rd, 2014, API v2.0. You should note that these are only the main categories of a page. Each Facebook Page has a
category_list
array field that has subcategories that are not shown here. You can get a list of all subcategories for places via the graph API by this query:search?type=place_topic&topic_filter=all
FYI since Facebook changes all the time, the easiest way to obtain the list is to do as @RichSutton suggested and go to the Create Page page, and do inspect element on the drop-down lists. 5-6 copy-pastes, a regex later you have your complete list (with some duplicates).
这里始终是新鲜的类别列表:
https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=search%3Ftype%3Dplacetopic%26topic_filter%3Dall%26limit%3D10000&version =v2.6
如果您想获取完整的类别列表,最好的方法是向此端点创建 openGraph 请求:
/search?type=placetopic&topic_filter=all&limit=10000
Here is always fresh list of category:
https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=search%3Ftype%3Dplacetopic%26topic_filter%3Dall%26limit%3D10000&version=v2.6
If you want get full list of category, best way is create openGraph request to this endpoint:
/search?type=placetopic&topic_filter=all&limit=10000
这是一个简单的(例如不需要 jQuery)Javascript 函数,它将从创建页面页面中提取 id/类别对:
Here's a plain (e.g. no jQuery required) Javascript function that will extract the id/category pairs from the create-a-page page:
权威列表可以从这里进行反向工程: http://www.facebook.com/pages/create .php。但目前还没有办法从图形 API 中以编程方式获取此信息。 +1 用于添加它。
The authoritative list can be reverse engineered from here: http://www.facebook.com/pages/create.php. But there currently is no way to get this programatically from the graph API. +1 for adding it.
截至 2013 年 10 月 17 日的类别列表。从页面设置中获取所有类别和猫 ID。
Category List as of Oct 17th 2013. Took all the categories and cat ID's from page settings.
排序&合并所有列表和创建页面:
151 个条目:
更新于 05-06-2015
Sorted & Merged all the lists and from the create page :
151 entries :
Updated on 05-06-2015
Ross,虽然我对此不是 100% 确定,但我的猜测是这些数据是由 Facebook 内部保存和更新的,所以如果你想在应用程序中使用它,你必须自己创建一个某种数组包含 Facebook 使用的所有(当前)类别 - 正如您在此处概述的那样(我已经广泛查看了他们的 API、图表等文档,并且不记得看到过任何关于如何获取兴趣类别的提及)。
您还可以查看此链接:
http://developers.facebook.com/docs/reference/fql/user
最好的。
Ross, although I am not 100% sure about this, my guess would be that this data is kept and updated internally by Facebook, and so if you wanted to use it in an app, you would have to make an array of some kind yourself containing all of the (current) categories used by Facebook - as you have outlined here (I have looked extensively through their API, Graph, etc documentation, and do not recall seeing any mention of how you can get categories for interests).
You might also have a look at this link:
http://developers.facebook.com/docs/reference/fql/user
Best.