Skip to content

Instantly share code, notes, and snippets.

@mrobers1982
Created March 1, 2012 18:49
Show Gist options
  • Save mrobers1982/1952082 to your computer and use it in GitHub Desktop.
Save mrobers1982/1952082 to your computer and use it in GitHub Desktop.
Engadget: sample code for LF Simple Profile Integration with LF comment widget
<script type="text/javascript" src="http://zor.aol.livefyre.com/wjs/v1.0/javascripts/livefyre_init.js"></script>
<script type="text/javascript" src="http://profiles-test.engadget.com/media/javascripts/simpleprofiles.js"></script>
<script type="text/javascript">
var engage = new fyre.sp.app.Engage({app: "aol"}),
profiles = new fyre.sp.app.Profile({}),
delegates = {
'handle_auth_login': function() {
engage.signIn();
},
'handle_auth_logout': function() {
engage.signOut();
},
'handle_edit_profile': function(user) {
profiles.editProfile();
},
'handle_view_profile': function(user) {
var id = user.jid.split('@')[0];
profiles.viewProfile(id);
}
};
fyre.sp.on('auth_logout_complete', function() {
LF.modules.Auth.logoutSuccess();
});
fyre.sp.on('profile_submit_complete', function(data) {
LF.Fyre.get('user').set({display_name: data.displayName});
});
fyre.sp.on('auth_login_complete', function(data) {
LF.ready(function() {
LF.login({
token: data.token,
profile: {display_name: data.displayName}
});
});
});
var conv=LF({
domain: "engadget-0.fyre.co",
site_id: <site id>,
article_id: '<article id>',
conv_meta: {<conv_meta>}
}).ready(function() {
LF.Dispatcher.addListener(delegates);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment