Created
September 22, 2012 17:55
-
-
Save rpearce/3767176 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ... | |
| events: { | |
| 'click .facebook-share' : 'postToFeed', | |
| }, | |
| postToFeed: function() { | |
| FB.init({appId: fb_app_id, status: true, cookie: true}); | |
| // calling the API ... | |
| var obj = { | |
| method: 'feed', | |
| link: 'http://www.google.com', | |
| picture: 'http://athena.cornell.edu/images/rovers/rover_sundial.jpg', | |
| name: 'My text about ' + this.model.get('something_interesting'), | |
| caption: '', | |
| description: 'Sweet! This is so great and about something interesting!', | |
| redirect_uri: 'your redirect URI' | |
| }; | |
| var self = this; | |
| FB.ui(obj, function(response) { | |
| self.callback(response); | |
| }); | |
| }, | |
| callback: function(response) { | |
| // callback where you do something with the response | |
| } | |
| // ... | |
| var fb_app_id = 'your facebook application id'; | |
| // ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment