2012-08-03 65 views
3

我正在開發一個Facebook應用程序,我想按學校篩選用戶的朋友。我遇到的問題是學校用戶的重複頁面可能沒有相同的頁面ID。重複頁面重定向:如何找到連接?

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

我一直沒能找到有關如何找到這些重定向連接的任何信息。理想情況下,我想:

  1. 如果我正在嘗試查看要重定向的頁面,如上例所示;什麼是我被重定向到的頁面ID?
  2. 如果我有一個頁面ID;什麼是所有相關的重複頁面ID?
+0

它看起來不像這些可通過API。 – cpilko 2012-08-03 21:19:15

+0

我希望有人找到一種方法來確定哪些ID是相互關聯的。感謝您的迴應。 – VIZZ1 2012-08-07 19:56:11

回答

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此任務,或者甚至可能使用刮板。我不是那些大規模解決這個問題的好辦法,但我建議,因爲如果你只是與大學打交道,那麼你可能負擔得起Mturk或者大量的刮蹭。

我確認您可以使用刮板查找重定向JavaScript並解析出原始頁面上的新ID。

我知道這有點糟糕,但希望它有幫助