Post to Facebook

Discussion in 'Programming' started by JamesIsDusk, May 18, 2012.

  1. #1
    I want to add a feature to my site that posts something on my users wall (with their approval of course) with a specific message. I've seen this with apps and such on Facebook but how can i do this on my site?
     
    JamesIsDusk, May 18, 2012 IP
  2. JamesIsDusk

    JamesIsDusk Guest

    Messages:
    52
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I found it! If anyone else wants to know, it's the following code!

    <html>
    <head>
    <title>My Facebook Login Page</title>
    </head>
    <body>
    <div id="fb-root"></div>
    <script>
    window.fbAsyncInit = function() {
    FB.init({
    appId : 'YOUR_APP_ID',
    status : true,
    cookie : true,
    xfbml : true,
    oauth : true,
    });

    FB.ui({ method: 'feed',
    message: 'Facebook for Websites is super-cool'});
    };

    (function(d){
    var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
    js = d.createElement('script'); js.id = id; js.async = true;
    js.src = "//connect.facebook.net/en_US/all.js";
    d.getElementsByTagName('head')[0].appendChild(js);
    }(document));
    </script>

    </body>
    </html>
     
    JamesIsDusk, May 19, 2012 IP
  3. kids

    kids Active Member

    Messages:
    411
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    68
    #3
    That's good idea, I will try it! Thanks!
     
    kids, May 20, 2012 IP
  4. sameerasam

    sameerasam Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    hmm good idea,i like it and i will try...:rolleyes:
     
    sameerasam, May 26, 2012 IP