Search code examples
facebooktwitterredisnodes

Post message to twitter and Facebbok from public chat


I have an open chat in my site. That means all users can write to public chat. This chat created in nodej+redis. So, I need that each message from each user will post to twitter for this user and to Facebook wall for this user. For example. User A post to chat some message and this message also post to user A twitter and user A Facebook wall. Please help - how I can do this.


Solution

  • You need the exact code? I can help you to find resources. For Facebook I'll explain step by step:

    1. You must create a new application on Facebook.
    2. You must chose the: Web page with facebook login
    3. Each of your users who visits your web page must authorize (login via Facebook) the application
    4. They must also give you and extanded permission publish stream and or publish action.
    5. Only after that you can publish on users behalf on his/her wal. This was the good news. The bad news is if you want to publish every single word the user types in your chat you will receive a negative user feedback from facebook and besides that facebook limits number of posts per day.(if I'm not mistaken the number is 12)

    Here are some links to relevant documentation:

    https://developers.facebook.com/docs/guides/web/

    https://www.facebook.com/blog/blog.php?post=41735647130

    https://developers.facebook.com/docs/howtos/login/getting-started/