defpull# Checks the validity of the JWT that Livefyre sends with pull requests. Throws an exception if it's no good.
validate_livefyre_request!user=User.find(params[:id])# livefile_profile will attempt to generate valid Livefire profile dump from the passed user record by guessing at field names.
# You can pass overides in a hash as the second option, or you can always generate your own data structure.
render:json=>livefire_profile(user,:image=>user.profile_image_url).to_jsonend

Finally, you'll need to set up a pull URL. Since this is done via the API, you are expected to do it manually. From a Rails console is fine, though
you may do it any other way you please, too. Livefyre will substitute the string "id" for the user ID it wants data for.

View integration

You'll also need to boot Livefyre with Javascript. In your application.js, you'll want to include the Livefyre loader in your manifest:

//=require livefyre.js

And then somewhere in your application.js, you'll want to actually boot:

window.initLivefyre({
login: function() {
// Things to do when the user clicks the "sign in" link. You probably want to
// take your user through a login cycle in a popup window, which includes calling
// the livefyre_login(user_id, user_name) method.
window.location = "/login";
},
logout: function() {
// things to do when the user clicks the "sign out" link. You probably want to take
// your user through the logout cycle, including a call to livefyre_logout.
window.location = "/logout";
},
viewProfile: function(handlers, author) {
// Handler for when a user's name is clicked in a comment
window.location = "/" + author;
},
editProfile: function(handlers, author) {
// Handler for when a user wants to edit their profile from the Livefyre user dropdown.
window.location = "/" + author + "/edit";
}
});