Search code examples
javascriptjqueryfacebookfacebook-graph-apisocial-media

adding events to facebook users profile using facebook graph api from a 3rd party web application


Need to send the event information to the users facebook profile, using jquery or javascript. A user logins into my web site and creates an event, but those event details has to be sent to his/her profile so that he can send invitation to his/her friends and they can RSVP to the events, my web site is based on jquery and javascript and have used java as middle ware and mysql 5.1 at the back end.

I just got with this when I googled http://www.triadwebcrafters.com/blog/?p=140

but its on cold fusion,

Is any one already done this before or any library or tutorials available.

Kindly help me


Solution

  • have your user logged in to facebook via the javascript facebook sdk.

    next, post to his profile:

    function publish_it()
    {
     var publish = {
      method: 'stream.publish',
      message: 'your message',
      attachment: {
        name: 'invitation',
        description: 'a very pretty invitation!',
        href: 'href to the invitation',
        media: [
                  { type: 'image', src: 'http://site.com/image.jpg', href: 'href to the invitation'}
                  ]
      },
      action_links: [
        { text: 'come as well!', href: 'href to the invitation' }
      ]};
    
    FB.ui(publish);    
    
      }