ページ

2011年6月23日木曜日

Facebook Chat Authenticating with Facebook Connect

Demo
http://nodebosh.herokuapp.com/facebook.html

source code

client side
server side
  • node.js0.4.7 on Heroku
  • node-xmpp-bosh

15 件のコメント:

  1. Great work kissrob.

    I tried to implement this for my application. I am able to connect faceook and fetch friendlist, but cant get "Strophe is connected" message.

    I have enabled openfire http-bind service.

    I found that when it does "/http-bind/", its not getting proper response. Its not getting desired stream response so it tries to connect it continuously.

    in response what I get is : "Openfire HTTP Binding Service" (in html tags)

    plz provide your inputs in it.

    返信削除
  2. hi, Dev.
    you mean that you use my code on not node.js+node-bosh but Openfire?

    I do not know abount openfire though.
    Is "/http-bind/" correct path in openfire?
    and, my sample customized node.js to generate SASL Chalenge.
    around line 154,
    https://github.com/kissrobber/facebook_chat_with_javascript_on_node.js/blob/master/facebook.html
    it can work without this customize, if you set app_secret(in line 96).

    To help your debug, you uncomment abount line 73~78.

    返信削除
  3. このコメントは投稿者によって削除されました。

    返信削除
  4. hi sensei
    I've tried to replicate your example and killed two days but it does not work for me...
    I installed in on Ubuntu according to readme file. node-xmpp-bosh seems to be working. server is working on 5280 port. but script itself, which is in your demo, for some reason tries to access http-bind, not 5280 but standard apache port - 80. this issue is eating my brain... can you please advice?
    my demo is on linux2.groupbwt.com, if you could check my log I would appreciate it
    domo arigato gozaimasu.

    返信削除
  5. Hi, Евгений
    my exapmle code is made for Heroku. therefore, if you want to run it in other environments, you have to modify it.
    (for details, refer to the documents of node, node-bosh, Heroku and others.)

    about port number,
    https://github.com/kissrobber/facebook_chat_with_javascript_on_node.js/blob/master/bosh.js.conf
    line 4, you can set any port number that you like.

    Incidentally,
    https://github.com/kissrobber/facebook_chat_awith_javascript_on_node.js/blob/master/src/bosh.js
    line 1837, you have to pass your FACEBOOK_API_SECRET.

    返信削除
  6. Thanks for your reply! Now i'm trying to run your script on Heroku. Bosh server seems to work fine. But authentication is not working. I've changed the app secret at line 97 and app id at line 204. Maybe there is some other places to correct.

    it's on:
    http://high-fog-846.herokuapp.com/facebook.html

    返信削除
  7. hi, Евгений
    I donot know why your program does not work.

    by the way,
    Do you set env vars?(api secret etc.)
    http://devcenter.heroku.com/articles/config-vars#cli_usage

    返信削除
  8. このコメントは投稿者によって削除されました。

    返信削除
  9. このコメントは投稿者によって削除されました。

    返信削除
  10. Hi,

    I want to use strophe and a bosh CM to enable facebook chat on my web app (similar to the example that you are showing here).

    I have a PC that runs ubuntu, and it is a web server (apache).

    My questions are:
    1. I saw that you use node-xmpp-bosh. Is it very complicated to install node-xmpp-bosh (I have a look on node-xmpp-bosh install instruction, seems so)?
    How did you set up your bosh?

    2. Do you have experience on punjab BOSH?

    返信削除
  11. Hi, stella0302

    ans are:
    1. No, install is very easy. Go to official site http://code.google.com/p/node-xmpp-bosh/
    2. No, I do not know pubjab BOSH. what's it?

    返信削除
  12. Hi Kissrobber,

    Do you know how to send message using facebook chat api?

    返信削除
  13. Yes,
    The chat is working on the facebook app which I made now.
    And the chat can send message.

    Facebook chat api specification was changed while after I post entry.
    However, fortunately, current specification has become simple enough to understand.

    Try to see this sample code.
    http://developers.facebook.com/docs/chat/

    返信削除
  14. I have played around the sample code from facebook chat api. Also, I have tested it.

    The result shows below:
    Test platform connect for XMPP
    access_token: AAACxtnTtRn8BAL84QIpkPKUU8IlsuWkz5QZCyytAxZCFC3Hgf8cFBYfT6GDEWcuOpRBWOs9t0UZAeybxa5uMkuqQcol90oZD
    server: chat.facebook.com
    uid: cc0430
    app id: 195397203871359
    [INFO] Opening connection... connnection open
    Authentication complete
    Done

    What should I do next step? Can you guide me?
    Thank you!

    返信削除
  15. Tell me all instructions to run this app on window plz

    返信削除