我正在开发一个Facebook应用程序,我希望通过学校过滤用户的朋友。我遇到的问题是,当学校用户有重复的页面时,可能没有相同的页面ID。
Ex)http://www.facebook.com/pages/UT-Austin/106258719412206将重定向到http://www.facebook.com/UTAustinTX?rf=106258719412206
我无法找到有关如何找到这些重定向连接的任何信息。理想情况下我想:
答案 0 :(得分:0)
您可以尝试的一件事是图搜索名称,理想情况是位置。在您的示例中,只是图形搜索名称提供了新页面作为第一个结果。 https://graph.facebook.com/search?q=UT+Austin&type=place&access_token=YOURTOKEN
这不理想,但我认为这是解决这个问题的唯一方法。
有几点需要注意: 您可以在您的情况下比较域名 您的first node:
{
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
您的second node也一样。
你可以使用is_community_page: true
作为触发器,你应该通过图搜索查找一些等效的ID。在所有情况下都不是这样,但因为你正在与大学打交道,我想每一个(至少在美国)都有一个声称的FB页面,在这种情况下is_community_page
将是假的或属性不存在(无)。
另外,根据您的业务,您可以完成此任务,甚至可能使用刮刀。我不是那些大规模解决这个问题的好方法,但我建议,因为如果你只是在与大学打交道,那么你可能买得起了Mturk或者是一个重大的解决方案。
我确认你可以使用刮刀查找重定向的javascript并解析原始页面上的新ID。
我知道这有点糟糕,但希望它有所帮助