這是真實的,PHP SDK不提供任何處理這些鏈接和文檔也沒有記錄。然而,API可以讓您在description
領域本身所需要的所有信息,所以這裏是你可以做什麼:
$description = "Live concert with @[66961492640:274:Moonbootica] "
. "in @[106078429431815:274:London, United Kingdom]! #musiC#house";
function get_html_description($description) {
return
// 1. Handle tags (pages, people, etc.)
preg_replace_callback("/@\[([0-9]*):([0-9]*):(.*?)\]/", function($match) {
return '<a href="http://facebook.com/'.$match[1].'">'.$match[3].'</a>';
},
// 2. Handle hashtags
preg_replace_callback("/#(\w+)/", function($match) {
return '<a href="http://facebook.com/hashtag/'.$match[1].'">'.$match[0].'</a>';
},
// 3. Handle breaklines
str_replace("\n", "<br />", $description)));
}
// Display HTML
echo get_html_description($description);
雖然2.
和3.
手柄井號標籤和特徵線,部分1.
的代碼基本上拆分了標籤
Live concert with <a href="http://facebook.com/66961492640">Moonbootica</a> in <a href="http://facebook.com/106078429431815">London, United Kingdom</a>! <a href="http://facebook.com/hashtag/music">#music</a> <a href="http://facebook.com/hashtag/house">#house</a>
演唱會與Moonbootica在:@[ID:TYPE:NAME]
分成3組的信息(ID,類型,名稱)從頁面編號和名稱生成HTML鏈接之前10! #music#house
FYI即使它沒有太多有用的,這裏有種類的含義:
- 一個應用程序(128),
- 頁面(274)
- 用戶(2048)。
當你得到那個請求時你正在做什麼? – WizKid 2014-12-08 00:13:53
在這種情況下,它是一個使用「https://graph.facebook.com/ {PAGE_ID}/albums」的頁面的相冊。某些專輯的「描述」恰好與另一個以此方式編碼的Facebook頁面有關聯。我不知道這是一種降價還是某種東西。您可以在圖形瀏覽器上看到它(向下滾動到「MODA MALTA 2014」條目並查看說明):https://developers.facebook.com/tools/explorer/?method = GET&path = 423178821079990%2Falbums&version = v2。 2 – jbx 2014-12-08 00:17:13
在https://developers.facebook.com/bugs – WizKid 2014-12-08 02:03:49