1
내 웹 서비스 (AppEngine Python)에서 Facebook 채팅 API를 사용하려고합니다. 내가 온라인에서 코드를 찾았지만, 그 중 어떤 것도 내가 작동하도록 도와 준다.Facebook Chat API - Python App Engine
이것은 내가 사용하고 있지만 작동하지 않는 코드입니다. 내가 뭘 잘못하고 있니?
class TestHandler(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'application/json'
response = dict()
msg = "hello world"
jid = "[email protected]"
pwd = "passwd"
server = "chat.facebook.com"
recipient="[email protected]"
try:
jid = xmpp.protocol.JID(jid)
cl = xmpp.Client(jid.getDomain(), debug=["always"])
if not cl.connect((server, 5222)):
response['Error Connection'] = 'Not connected.'
elif cl.auth(jid.getNode(), pwd) == None:
response['Error Auth'] = 'Authentication failure.'
else:
cl.send(xmpp.protocol.Message(recipient, msg, "chat"))
cl.disconnect()
response['status'] = 'success'
except:
response['status'] = 'failed'
self.response.out.write(json.dumps(response))
내가 내 친구의 ID와 "passwd에"의 "TARGETID을"변경 내가 페이스 북과 "MYID"에 비밀번호를 넣어 나는 변경 내 ID in FB – rcmcastro
오류 메시지는 무엇입니까? – Rodrigo