3

我正在开发一个 Facebook 应用程序,我想按学校过滤用户的朋友。我遇到的问题是,当学校用户的重复页面可能没有相同的页面 ID 时。

例如)http://www.facebook.com/pages/UT-Austin/106258719412206将重定向到http://www.facebook.com/UTAustinTX?rf=106258719412206

我无法找到有关如何找到这些重定向连接的任何信息。理想情况下,我想:

  1. 如果我正在尝试查看要重定向的页面,如上例所示;我被重定向到的页面 ID 是什么?
  2. 如果我有页面 ID;所有重复的页面 ID 与哪些相关?
4

1 回答 1

0

您可以尝试的一件事是图形搜索名称和理想的位置。在您的示例中,只需图形搜索名称即可提供新页面作为第一个结果。 https://graph.facebook.com/search?q=UT+Austin&type=place&access_token=YOURTOKEN

这并不理想,但我认为这是解决这个问题的唯一方法。

需要注意的几点:您可以根据自己的情况比较域。
您的第一个节点

{
category: "University",
description: "The University of Texas at Austin is a public research-intensive university located in Austin, Texas, United States. It is the flagship institution of the University of Texas System. Founded in 1883, its campus is approximately 0.25 miles from the Texas State Capitol in Austin. The institution has the fifth-largest single-campus enrollment in the nation, with over 50,000 undergraduate and graduate students and over 24,000 faculty and staff.The University of Texas at Austin was named one of the original eight Public Ivy institutions and was inducted into the American Association of Universities in 1929. The university is a major center for academic research, with research expenditures exceeding $640 million for the 2009–2010 school year. The university houses seven museums and seventeen libraries, including the Lyndon Baines Johnson Library and Museum and the Blanton Museum of Art, and operates various auxiliary research facilities, such as the J. J. Pickle Research Campus and the McDonald Observatory. Among university faculty are recipients of the Nobel Prize, Pulitzer Prize, the Wolf Prize, and the National Medal of Science, as well as many other awards.",
is_community_page: true,
is_published: true,
talking_about_count: 8,
website: "http://www.utexas.edu",
were_here_count: 0,
id: "106258719412206",
name: "UT Austin",
link: "http://www.facebook.com/pages/UT-Austin/106258719412206",
likes: 5143
}

有 www.utexas.edu

您的第二个节点具有相同的功能。

您可能可以将is_community_page: true用作触发器,您应该通过图形搜索查找一些等效的 ID。在所有情况下都不是这样,但是因为您正在与大学打交道,所以我想每个人(至少在美国)都有一个声称的 FB 页面,在这种情况下is_community_page将是错误的或该属性将不存在(无)。

此外,根据您的业务,您可以 MTurk 这个任务,甚至可能使用刮板。我不认为这些是大规模解决这个问题的好方法,但我建议是因为如果你只与大学打交道,你可能负担得起 Mturk 或繁重的刮擦。

我确实确认您可以使用刮板来查找重定向 javascript 并解析出原始页面上的新 ID。

我知道这有点糟糕,但希望它有所帮助

于 2013-07-19T00:10:35.093 回答