컴

FaceBook 사진 올리면서 태그 같이 넣기

· 2013-11-23 (토) 11:03:24 · 3667
publish_stream 권한 필요.
<%=access_token%>는 미리 가져온 토큰.
target_id:to_id를 주석 해제하면 내 앨범이 아니라 친구 앨범에 추가됨. (동의 없이) - 1회만 해 본 거라 정확하지 않음
$는 제이쿼리
    function postToFeed(to_id,to_name,imgURL,message){
      $('#wait_div').html('담벼락에 게시하고 있습니다.').show()
    // 자기 담벼락에 사진 올리기 - 자동 (동의 절차 없음)
    FB.api('/photos','post',{
        message:$('#name').val()+'님이 '+to_name+'님에게 All New Style 2013 Spark를 타고 영화를 보러 가길 초대합니다.\n\n'+message,
        //target_id:to_id,  //친구에게 사진 올리기 (동의 절차 없음)
        uid:$('#id').val(),
        access_token:'<%=access_token%>',
        tags:[{
          tag_uid:to_id,
          x:20,
          y:40
        }],
        url:imgURL
      },
      function(response){
        if(!response || response.error){
          $('#wait_div').html('Error occured:'+response.error.message)
        } else {
          $('#wait_div').html('담벼락에 게시하였습니다.').show()
          $('#wait_div').html($('#wait_div').html()+'<br>Photo Post ID:'+response.id)
          $('#process_2').hide()
          if(auto_commit){
            $('#mobile').attr('class','')
            $('#form').submit()
            $('#process_4').show()
          }
          else{
            $('#process_3').show()
          }
        }
      }
    )
}
|
댓글을 작성하시려면 로그인이 필요합니다.

개발자팁

5,403건

개발과 관련된 유용한 정보를 공유하세요. 질문은 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
jQuery 14-03-30 조회 4,443
PHP 14-03-25 조회 8,153
PHP 14-03-25 조회 4,368
jQuery 14-03-23 조회 1.5만
MySQL 14-03-17 조회 1.6만
PHP 14-03-12 조회 4,241
PHP 14-03-12 조회 8,078
JavaScript 14-03-03 조회 3,586
JavaScript 14-02-25 조회 1만
PHP 14-02-24 조회 7,090
JavaScript 14-02-14 조회 6,503
JavaScript 14-02-13 조회 5,742
jQuery 14-02-12 조회 3,493
기타 14-01-10 조회 6,086
JavaScript 14-01-03 조회 5,726
웹서버 14-01-03 조회 5,055
웹서버 14-01-03 조회 1.3만
OS 14-01-03 조회 5,144
PHP 13-12-27 조회 3,961
기타 13-12-09 조회 3,569
JavaScript 13-12-06 조회 4,212
기타 13-11-23 조회 5,287
기타 13-11-23 조회 4,002
기타 13-11-23 조회 4,141
기타 13-11-23 조회 3,668
JavaScript 13-11-22 조회 6,335
기타 13-11-18 조회 4,344
PHP 13-11-18 조회 4,047
PHP 13-11-18 조회 1.4만
JavaScript 13-11-18 조회 3,675