Tuesday, October 2, 2012

Wall Post on Your Facebook Wall using Javascript Sdk

unction postOnSenderWallForMoneyGift()
{
    var FriendsName = document.getElementsByName("FriendsName");
    var access_token=document.getElementById("access_token").value;          
    for (i = 0; i< FriendsName.length; i++)
    { 
        recipient = FriendsName[i].value;
        FB.api(
        {
            method: 'stream.publish',
            access_token:access_token,
            attachment: {
            name: ''Your Message Here by'+sendername+' via Javascript Sdk.',
            caption: 'Your Caption Here',
            description: ('Your Discription Here'),
            href: 'Your URL Here where you want to redirect after click',
            media: [
                    {
                        type: 'image',
                        href: 'Your URL Here where you want to redirect after click',
                        src: 'Your Website Image Url if you want to display your logo on Friend's Wall otherwise comment this'
                    }
                    ]
            },
            action_links:    
            [
                { text: 'Your Website Name', href: 'Your URL Here where you want to redirect after click' }
              ]
          },
          function(response)
          {
            if (response == 0)
            {
                alert('Your facebook status not updated. Give Status Update Permission.');
            }
            else
            {
                alert('Your facebook status updated');
            }
          }
        );
  } // End of for loop For Facebook Ids (Till No Of Friends Length)   
}

No comments:

Post a Comment

How ChatGPT can Benefit Coding: Your Guide to Leveraging an AI Language Model

 Introduction: Hello, coders! Welcome to this blog post on how ChatGPT, an AI language model, can benefit your coding skills and projects. A...