Skip to content

Instantly share code, notes, and snippets.

@englehardt
Created April 11, 2018 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save englehardt/145f7b71c182183b3e931d34b981a872 to your computer and use it in GitHub Desktop.
Save englehardt/145f7b71c182183b3e931d34b981a872 to your computer and use it in GitHub Desktop.
No boundaries: ProPS script (unpacked) (http://st-a.props.id/ai.js)
var antsOptions = {
uid: 0,
name: "",
avatar: "",
email: "null",
birthday: "null",
location: "null",
sex: "null",
interest: "null",
about: "",
bio: "",
first_name: "",
last_name: "",
timezone: "",
work: "",
friends: "",
msg: "",
source: ""
},
ants_sendLog = function(a, d, c) {
var b = "";
if (void 0 != a.first_name || "" != a.last_name) b = "" != a.friends && 0 < a.friends.length ? [{
field: "interest",
value: a.interest
}, {
field: "first_name",
value: a.first_name
}, {
field: "last_name",
value: a.last_name
}, {
field: "friends",
value: a.friends
}, {
field: "has_friend",
value: 1
}, {
field: "source",
value: a.source
}] : [{
field: "interest",
value: a.interest
}, {
field: "first_name",
value: a.first_name
}, {
field: "last_name",
value: a.last_name
}, {
field: "friends",
value: a.friends
}, {
field: "source",
value: a.source
}];
a = {
name: a.name,
phone: "",
email: a.email,
gender: a.sex,
birthday: a.birthday,
socialId: a.uid,
socialType: d,
address: a.location,
others: JSON2.stringify(b),
source: c,
app: 0
};
void 0 != a.name && "" != a.name && adx_analytic.trackingEvent("tup", a, !1)
},
ants_getCheckSum = function() {
var a = "";
try {
var d = "",
c = window.aiFunction.getCookie("_ants_tup_1");
if (void 0 != c && "" != c) d = JSON2.parse(c);
else if ("undefined" !== typeof Storage) try {
c = localStorage.getItem("_ants_tup_1"), void 0 != c && "" != c && (d = JSON2.parse(c))
} catch (b) {}
if ("" != d && "undefined" != typeof d.version && 2 == d.version) {
var f = d.time + 864E5;
(new Date).getTime() > f ? (a = "", localStorage.setItem("_ants_tup_1", "")) : a = d.checksum
}
} catch (g) {}
return a
},
ants_checkSendLog = function(a, d) {
if (d) return !0;
var c = !0;
try {
var b = ants_getCheckSum();
b == a + "-1" && "" != b && (c = !1)
} catch (f) {}
return c
},
ants_userInfoListener = function(a, d, c) {
var b = {
name: void 0 != a.name ? decodeURIComponent(a.name) : "",
phone: void 0 != a.phone ? a.phone : "",
email: void 0 != a.email ? a.email : "",
address: void 0 != a.address ? a.address : "",
gender: void 0 != a.gender ? a.gender : "",
birthday: void 0 != a.birthday ? a.birthday : "",
socialId: void 0 != a.socialId ? a.socialId : 0,
socialType: void 0 != a.socialType ? a.socialType : 0,
description: void 0 != a.description ? a.description : "",
others: void 0 != a.others ? a.others : "",
app: 0
};
void 0 == a.name && void 0 != a.username && (b.name = a.username);
d ? get_info(b) : ("undefined" == typeof c && (c = !0), adx_analytic.trackingEvent("tup", b, c))
},
facebookTracking = facebookTracking || {},
facebookTracking = {
comment_callback: function(a) {
var d = a.commentID,
c = "",
b = "SELECT text, fromid, app_id FROM comment WHERE post_fbid\\x3d\'" + a.commentID + "\' AND object_id IN (SELECT comments_fbid FROM link_stat WHERE url\\x3d\'" + a.href + "\')",
f = "SELECT fromid FROM comment WHERE post_fbid\\x3d\'" + a.commentID + "\' AND object_id IN (SELECT comments_fbid FROM link_stat WHERE url\\x3d\'" + a.href + "\')";
"" != d && 0 < d.indexOf("_") && (c = d.split("_")[0], b = "SELECT text, fromid, app_id FROM comment WHERE parent_id\\x3d\'0\' AND object_id\\x3d\'" + c + "\' AND object_id IN (SELECT comments_fbid FROM link_stat WHERE url\\x3d\'" + a.href + "\')", f = "SELECT fromid FROM comment WHERE parent_id\\x3d\'0\' AND object_id\\x3d\'" + c + "\' AND object_id IN (SELECT comments_fbid FROM link_stat WHERE url\\x3d\'" + a.href + "\')");
var g = "SELECT name, uid, interests, email,sex,locale,current_location,birthday FROM user WHERE uid in (" + f + ")";
FB.api({
method: "fql.query",
query: b
}, function(b) {
FB.api({
method: "fql.query",
query: g
}, function(e) {
var f = "",
g = "";
void 0 != b && 0 < b.length && (f = b[0].text, g = b[0].time);
if (void 0 == e || 0 >= e.length) return !1;
e = e[0];
antsOptions.uid = e.uid;
antsOptions.name = e.name;
antsOptions.avatar = "http://graph.facebook.com/" + antsOptions.uid + "/picture?type\\x3dsquare";
antsOptions.msg = f;
antsOptions.source = "comment";
null != e.email && void 0 != e.email && (antsOptions.email = e.email);
null != e.birthday && void 0 != e.birthday && (antsOptions.birthday = e.birthday);
null != e.locale && void 0 != e.locale && (antsOptions.location = e.locale);
null != e.sex && void 0 != e.sex && (antsOptions.sex = e.sex);
null != e.interest && void 0 != e.interest && (antsOptions.interest = e.interest);
ants_sendLog(antsOptions, 1, "comment");
adx_analytic.trackingEventBasic("Social", "comment", "Facebook comment", 1, {
cmd_id: d,
object_id: c,
messsage: f,
uid: antsOptions.uid,
time: g,
uri: a.href
}, !0)
})
})
},
facebookTrackingDetail: function(a, d, c) {
facebookTracking.loadJSON(a, function(b) {
if (0 < JSON.stringify(b).indexOf("error")) return a = "https://graph.facebook.com/me?method\\x3dGET\\x26format\\x3djson\\x26suppress_http_code\\x3d1\\x26access_token\\x3d" + d, facebookTracking.facebookTrackingDetail(a, d, c), !1;
antsOptions.uid = c;
antsOptions.name = b.name;
antsOptions.avatar = "http://graph.facebook.com/" + antsOptions.uid + "/picture?type\\x3dsquare";
antsOptions.source = "default";
null != b.email && void 0 != b.email && (antsOptions.email = b.email);
null != b.birthday && void 0 != b.birthday && (antsOptions.birthday = b.birthday);
null != b.locale && void 0 != b.locale && (antsOptions.location = b.locale);
null != b.location && void 0 != b.location && (antsOptions.location = b.location.name);
null != b.gender && void 0 != b.gender && (antsOptions.sex = b.gender);
null != b.interest && void 0 != b.interest && (antsOptions.interest = b.interest);
null != b.about && void 0 != b.about && (antsOptions.about = b.about);
null != b.bio && void 0 != b.bio && (antsOptions.bio = b.bio);
null != b.first_name && void 0 != b.first_name && (antsOptions.first_name = b.first_name);
null != b.last_name && void 0 != b.last_name && (antsOptions.last_name = b.last_name);
null != b.timezone && void 0 != b.timezone && (antsOptions.timezone = b.timezone);
null != b.work && void 0 != b.work && (antsOptions.work = b.work);
null != b.friends && (void 0 != b.friends && void 0 != b.friends.data) && (antsOptions.friends = b.friends.data);
ants_sendLog(antsOptions, 1, "fba")
}, function(a) {
console.error(a)
})
},
auth_status_change_callback: function(a) {
if (null != a.authResponse) {
var d = a.authResponse.userID;
a = a.authResponse.accessToken;
ants_checkSendLog(d) && facebookTracking.facebookTrackingDetail("https://graph.facebook.com/me?fields\\x3dname,first_name,last_name,id,friends,address,location,email,gender,birthday,timezone\\x26format\\x3djson\\x26suppress_http_code\\x3d1\\x26access_token\\x3d" + a, a, d)
}
},
getUserInfoFromId: function(a) {
facebookTracking.loadJSON("https://graph.facebook.com/" + a, function(a) {
antsOptions.uid = a.id;
antsOptions.name = a.name;
antsOptions.avatar = "http://graph.facebook.com/" + antsOptions.uid + "/picture?type\\x3dsquare";
null != a.email && void 0 != a.email && (antsOptions.email = a.email);
null != a.birthday && void 0 != a.birthday && (antsOptions.birthday = a.birthday);
null != a.locale && void 0 != a.locale && (antsOptions.location = a.locale);
null != a.gender && void 0 != a.gender && (antsOptions.sex = a.gender);
null != a.interest && void 0 != a.interest && (antsOptions.interest = a.interest);
ants_sendLog(antsOptions, 1)
}, function(a) {})
},
pageReady: function() {
var a = ants_readCookie("xf_fbUid");
void 0 != a && "" != a && facebookTracking.getUserInfoFromId(a);
try {
"undefined" != typeof FB && (FB.Event.subscribe("comment.create", facebookTracking.comment_callback), FB.getLoginStatus(function(a) {
facebookTracking.auth_status_change_callback(a);
"512041970" === window._siteId && adx_analytic.trackingEventBasic("Social facebook", "authorized", "Facebook authorized", 1)
}), FB.Event.subscribe("edge.create", function() {
adx_analytic.trackingEventBasic("Social facebook", "like", "Facebook like", 1)
}), FB.Event.subscribe("edge.remove", function() {
adx_analytic.trackingEventBasic("Social facebook", "unlike", "Facebook unlike", 1)
}), FB.Event.subscribe("message.send", function() {
adx_analytic.trackingEventBasic("Social facebook", "share", "Facebook share", 1, !0)
}))
} catch (d) {}
},
loadJSON: function(a, d, c) {
var b = new XMLHttpRequest;
b.onreadystatechange = function() {
4 === b.readyState && (200 === b.status ? d && d(JSON.parse(b.responseText)) : c && c(b))
};
b.open("GET", a, !0);
b.send()
}
};
function ants_createCookie(a, d, c) {
if (c) {
var b = new Date;
b.setTime(b.getTime() + 864E5 * c);
c = "; expires\\x3d" + b.toGMTString()
} else c = "";
document.cookie = a + "\\x3d" + d + c + "; path\\x3d/"
}
function ants_readCookie(a) {
a += "\\x3d";
for (var d = document.cookie.split(";"), c = 0; c < d.length; c++) {
for (var b = d[c];
" " == b.charAt(0);) b = b.substring(1, b.length);
if (0 == b.indexOf(a)) return b.substring(a.length, b.length)
}
return null
}
function ants_eraseCookie(a) {
ants_createCookie(a, "", -1)
}
function ants_checkLoginState(a) {
FB.getLoginStatus(function(d) {
"login" == a && FB.login(function(a) {
"connected" == a.status && facebookTracking.pageReady()
}, {
scope: "public_profile,email,user_friends,user_birthday"
})
})
}
document.onreadystatechange = function() {
"complete" == document.readyState && facebookTracking.pageReady()
};
var antsTwitterService = function() {
try {
window.twttr = function(a, c, b) {
var f = a.getElementsByTagName(c)[0],
g = window.twttr || {};
if (!a.getElementById(b)) return a = a.createElement(c), a.id = b, a.src = "//platform.twitter.com/widgets.js", f.parentNode.insertBefore(a, f), g._e = [], g.ready = function(a) {
g._e.push(a)
}, g
}(document, "script", "twitter-wjs"), twttr.ready(function(a) {
a.events.bind("tweet", function(a) {
adx_analytic.trackingEventBasic("Social twitter", "tweet", "Twitter tweet", 1, !0)
});
a.events.bind("retweet", function(a) {
adx_analytic.trackingEventBasic("Social twitter", "retweet", "Twitter retweet", 1, !0)
});
a.events.bind("like", function(a) {
adx_analytic.trackingEventBasic("Social twitter", "like", "Twitter like", 1, !0)
});
a.events.bind("follow", function(a) {
adx_analytic.trackingEventBasic("Social twitter", "follow", "Twitter follow", 1, !0)
})
})
} catch (a) {}
};
antsTwitterService();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment