2014-03-04 6 views
0

별칭 (사용자 이름)별로 그룹을 가져 오는 방법이 있습니까?FB 별칭 (FQL)을 얻는 방법

SELECT id, name, pic_big, type, url, username FROM profile WHERE username='somealias' 

은 페이지에서 작동하지만 그룹에는 사용할 수 없습니다. 그룹의 경우는

(#803) Some of the aliases you requested do not exist: somealias 

답변

3

profile 테이블 user, group, page, event, 또는 application 테이블에 대한 부모 클래스처럼 반환합니다. 이 필드 username가 있지만,이 필드의 값이 관련 테이블로부터 충전되며, 테이블 그룹에는 필드를 username (https://developers.facebook.com/docs/reference/fql/group 참조)이없는

(https://developers.facebook.com/docs/reference/fql/profile/ 참조). 우리가 where id = someid를 사용하여 프로파일 쿼리 할 때 그래서 우리는 결과를 얻을 :

SELECT id, name, pic_big, type, url, username FROM profile WHERE id= '195466193802264' 
 
{ 
    "data": [ 
    { 
     "id": 195466193802264, 
     "name": "Facebook Developers", 
     "pic_big": "https://www.facebook.com/images/litestand/bookmarks/sidebar/icons/groups/icon-default.png", 
     "type": "group", 
     "url": "https://www.facebook.com/groups/195466193802264/", 
     "username": "" 
    } 
    ] 
} 

당신이 볼 수 있듯이, 사용자 이름이 그룹에 대한 비어 있습니다.

업데이트는 일부 조사 후 나는 그룹이 사용자 이름을 가질 수 있음을 발견했다. 과격하게 그들은 할 수는 없지만 @ 기호 앞에 그룹의 전자 메일 부분은 사용자 이름입니다.

사용자 이름 만 지정하면 프로필을 쿼리 할 때 아무 것도받지 못합니다. 그러나 이름을 추가하면 그룹이 나타납니다.

예 :

 
{ 
    "data": [ 
    { 
     "id": 268045023346892, 
     "name": "ROCK MUSIC FANS CLUB", 
     "pic_big": "https://www.facebook.com/images/litestand/bookmarks/sidebar/icons/groups/icon-guitar.png", 
     "type": "group", 
     "url": "https://www.facebook.com/groups/rock.mfc/", 
     "username": "rock.mfc" 
    } 
    ] 
} 
:

SELECT id, name, pic_big, type, url, username FROM profile 
    WHERE username = 'rock.mfc' and type = 'group' 

 
{ 
    "data": [ 
    ] 
} 

그러나

SELECT id, name, pic_big, type, url, username FROM profile 
    WHERE name = 'ROCK MUSIC FANS CLUB' and username = 'rock.mfc' and type = 'group' 

필요한 결과를 줄 것이다 쿼리를 발생합니다

희망을 부탁드립니다.

+0

그래서 별칭으로 그룹을 가져 오는 것은 불가능합니다. 어디에서 그룹 ID와 별칭 사이의 연결을 찾을 수 있습니까? –

+0

https://developers.facebook.com/docs/reference/fql/group - 엔티티 '그룹'에있는 파일이 있습니다. 그래서 당신은'name'을 사용할 수 있습니다 - 그룹의 전체 이름 (예 : "Facebook Developers") 또는 ID – user15

+0

그게 내 작업이 불가능하다는 것을 의미합니다. 예 아니오? :) 이름이 사용자 이름과 달리 고유하지 않습니다. –