Skip to content

Instantly share code, notes, and snippets.

@mrobers1982
mrobers1982 / gist:2885094
Created June 6, 2012 21:59
Backplane/Federate SSO - missing displayName Patch
LF.config.jr_profile_cookie = 'janrainProfile';
LF.modules.Auth.userAuthSuccess = LF.modules.Auth.userAuthSuccess = function(response) {
clearTimeout(LF.Helpers.auth_timeout);
LF.Helpers.auth_timeout=null;
//backward compatibility if response is not wrapped
var result = response.data || response;
LF.Logger.stream('AUTH: Successfully logged the user in, jid is: '+ result.jid);
LF.Logger.log_default("***** LIVEFYRE: USER AUTH SUCCESS:", (typeof(result.jid) == 'undefined' || result.jid.indexOf('anonymous') > -1 ? 'Anonymous' : 'Authed user'));
@mrobers1982
mrobers1982 / gist:2855692
Created June 1, 2012 23:12
FOX: Capture to Livefyre Schema Maps
-- Fox Sports --
{
"bio": "aboutMe",
"display_name": ["FSCOM", "SCREENNAME"],
"autofollow_conversations": ["FSCOM", "livefyre_settings", "livefyre_autofollow_conversations"],
"email": "email",
"connections": "profiles",
"image_url": ["FSCOM", "AVATARS"],
"photo_approval_status": ["FSCOM", "photo_approval_status"],
@mrobers1982
mrobers1982 / gist:2846878
Created May 31, 2012 22:40
FoxSports - Livefyre custom delegates
var fyre = LF({
domain: "foxsports-0.fyre.co",
site_id: "3000012",
article_id: lf_articleId,
backplane: Backplane
});
var auth_delegate = {
handle_auth_login: function () {
CAPTURE.startModalLogin();
Backplane.expectMessages("identity/login");
@mrobers1982
mrobers1982 / gist:2840368
Created May 31, 2012 01:58
Fix to make changeConversation work better - use a closure to keep track of timeout ID
setSlide:function(slide){
var slideHTML = '';
if (typeof slide == 'object') { // VVMPhoto object
var image = slide;
slideHTML = '<img '+(image.caption!=''?'title="'+image.caption.replace(/<(?:.|\n)*?>/gm, '')+'"':'')+' src="'+image.url+'"/>';
if(!this.settings.streetteam){
if(image.credit != '')
slideHTML += '<small>'+image.credit+'</small>';
if(image.caption != '')
@mrobers1982
mrobers1982 / gist:2784891
Created May 24, 2012 23:38
Engadget LFSP/LF Mobile init script
<script type="text/javascript">
var authDelegate = new fyre.conv.SPAuthDelegate({"engage": {"app": "login.aoltech.com", "type": "redirect"}, "profiles": {"type": "redirect"}});
var lf_config = [{"collectionMeta":"eyJ0eXAiOiJqd3QiLCJhbGciOiJIUzI1NiJ9.eyJ0aXRsZSI6IlNoYXJwIiwidXJsIjoiaHR0cDpcL1wvbGl2ZWZ5cmUyLnNhbmRib3guZW5nYWRnZXQuY29tXC8yMDEyXC8wNVwvMjRcL3NoYXJwLXJlcG9ydGVkbHktaGVscGluZy1ob24taGFpLXByZWNpc2lvbi1tb2JpbGUtZGlzcGxheXNcLyIsInRhZ3MiOiIiLCJjaGVja3N1bSI6ImY4MWM5NGNjMzIyOGQxNjZkNjEwYTE1YjIwZDc4NjI5IiwiYXJ0aWNsZUlkIjoiMjAyNDQxNzkifQ.oJNDEnQ1vVFkvH3UtOEpQQx0OWCk4YU2Po6L6opvjok","checksum":"f81c94cc3228d166d610a15b20d78629","siteId":"303620","articleId":"20244179","el":"lf_comment_stream","network":null}];
var conv = fyre.conv.load({"network": "engadget-2.fyre.co", "authDelegate": authDelegate}, lf_config);
</script>
@mrobers1982
mrobers1982 / gist:2778630
Created May 24, 2012 00:38
Custom Delegates for SpeedTV
var speed_auth_delegate = {
handle_auth_login: function() {
jQuery.speed.fanatics.auth.startLogin();
return false;
},
handle_auth_logout: function() {
jQuery.speed.fanatics.menu.logout();
return false;
}
};
@mrobers1982
mrobers1982 / lfsp_remove_dups.py
Created April 12, 2012 19:00
Remove duplicate user records create by race condition w/lfsp & lfdj
def lfsp_remove_dups(domain_id):
import datetime
import time
query = '''
SELECT *
FROM user_profiles u1
WHERE domain_id = %s
AND EXISTS (SELECT *
FROM (SELECT jid
@mrobers1982
mrobers1982 / gist:1952082
Created March 1, 2012 18:49
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() {
@mrobers1982
mrobers1982 / default.aspx
Created January 12, 2012 10:23
.NET bootstrap html example
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="WebApplication1._default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">