// ==UserScript==
// @name Mafia Wars Facebook Auto Comment Feed
// @namespace http://screepts.com
// @version 1.65
// @date 2014-08-07
// @description Auto Adds Random Text To Your Mafia Feeds
// @copyright 2010-2014 screepts.com
// @match *://www.facebook.com/dialog/*
// @match *://facebook.com/dialog/*
// @match *://apps.facebook.com/*
// @include *://www.facebook.com/dialog/*
// @include *://facebook.com/dialog/*
// @include *://apps.facebook.com/*
// @icon http://mwscripts.screepts.netdna-cdn.com/images/lucifersicon.jpg
// @grant unsafeWindow
// @grant GM_xmlhttpRequest
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
// ==/UserScript==
//////////////////////////////////////////////////////////////////////////////////////////////
// This code was brought to you by todays letters kids 666 //
// http://screepts.com muahahahaha //
// if you love it share it!!! //
// {Don't be evil & remove my header, love it, leave it & share it...} //
// //
//////////////////////////////////////////////////////////////////////////////////////////////
// Copyright(C) 2011 Luke Hardiman, lucifer@screepts.com //
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php //
//////////////////////////////////////////////////////////////////////////////////////////////
var facebookAutoComment="("+function(){function autocomment(){if(document.getElementsByClassName("uiAttachmentTitle")[0]==null||typeof document.getElementsByClassName("uiAttachmentTitle")[0]=="undefined"||document.getElementsByClassName("uiAttachmentTitle")[0]==undefined){return}var AutoComment=document.getElementsByClassName("uiAttachmentTitle")[0].getElementsByTagName("a")[0].innerHTML;var AutoMessage=document.getElementsByClassName("uiAttachmentDesc").innerHTML;var fight_boost_quotes=new Array;fight_boost_quotes[0]="Im on fire :).. \nwhos next!!";fight_boost_quotes[1]="im on a killing spree.... mofo!!";fight_boost_quotes[2]="Tolda ya i would get ya!!";fight_boost_quotes[3]="Honesty he should have stayed dead!!!";fight_boost_quotes[4]="pfffft, he thawt he had big guns :)..";fight_boost_quotes[5]="s&*T be free boosts all night :)";fight_boost_quotes[6]="Whos Ma B&*^%";fight_boost_quotes[7]="Owned...";fight_boost_quotes[8]="Free boost :)";fight_boost_quotes[9]="Yet another free boost :)";fight_boost_quotes[10]="Tick Tick, BOOM.... \nAnother Free Boost :)";fight_boost_quotes[11]="hahaha to easy :)";fight_boost_quotes[12]="ICE ICE BABY!!! :)";fight_boost_quotes[13]="hahahahaaa\nSmashing them tonight :)";fight_boost_quotes[14]="err did i just ice you twice\nMy bad... trigger happy :)";fight_boost_quotes[15]="Simon says\n.....Play Dead.... lol";fight_boost_quotes[16]="(+ +) {R.i.P}";fight_boost_quotes[17]="Look @ my total ices now...";fight_boost_quotes[18]="BOOOOOMMMMM!!!!!!!!\nthat was the sound of u getting assassinated";fight_boost_quotes[19]="i love killing...";fight_boost_quotes[20]="you were on my hitlist ...\nnow whos next :)";fight_boost_quotes[21]="im like, a mini Bruce Lee ...";fight_boost_quotes[22]="B&*^%, SLAPPED YA!! lol";fight_boost_quotes[23]="hahahaha, Dont know who started that fight.\nbut i smashed ya!!!!";fight_boost_quotes[24]="Im giving the boosts away tonite :)\nnow for the next target";fight_boost_quotes[25]="giving out smackdowns!!!!!";fight_boost_quotes[26]="You just killed your foe, now brag about it.\nhmmm Brag about it... pfffft im out for blood....";fight_boost_quotes[27]="Who killed kenny LOL :)";fight_boost_quotes[28]="OMG i was going easy on that dude :)";fight_boost_quotes[29]="{keeel..////\n.oOO-(^.0)-OOo or be Keeld..}";fight_boost_quotes[30]="Whos next :)";fight_boost_quotes[31]="Killing it in new york tonight.....";fight_boost_quotes[32]="He started, honest :)";var level_quote=new Array;level_quote[0]="Im on fire :).. \nLeveled.. come claim a reward!!";level_quote[1]="Mofo!!\nParty..";level_quote[2]="Leveling like a mad man..!!";level_quote[3]="Sharing the love :)!";level_quote[4]="Just leveled :)\nSharing the rewards....";var war_quote=new Array;war_quote[0]="WAAAAAAAAAAARRRRRRR!!";war_quote[1]="WAR!!!!!!!!\nNeed Help please!!!";war_quote[2]="HELP!!!!\nWAR!!!!!!!";war_quote[3]="Rally up guys....\nWAR!!!!!";war_quote[4]="Lets Go WARRRR!!!!!!";war_quote[5]="Mafia need your help please...\nWAR!!!!";war_quote[6]="Need help please guys... \ngreat rewards on this war!!!";war_quote[7]="Help me on my war please!!!!";var daily_quote=new Array;daily_quote[0]="Hurry.. cple good items left!!!";daily_quote[1]="Sharing The love :)";daily_quote[2]="few good items left to collect....";daily_quote[3]="Some good items still left to collect...";daily_quote[4]="Daily Take... 1st in 1st served...";daily_quote[5]="lol.. left some good items to claim still";var crew_quote=new Array;crew_quote[0]="Need some crew members thanks!!! :)'";crew_quote[1]="Come join ma crew..:)";crew_quote[2]="Couple spots left to fill....";crew_quote[3]="Crew members needed\nthanks!!!";crew_quote[4]="Have a few spots to fill!!!";crew_quote[5]="Join my elite crew..";crew_quote[6]="Dammm bandits.....";var family_boss_quote=new Array;family_boss_quote[0]="Need to reload.....";family_boss_quote[1]="Want to smash this boss tonight!!..";family_boss_quote[2]="Need a few boosts please.....";family_boss_quote[3]="Damm ive been smashin him with combos.....";family_boss_quote[4]="Need to keep the presure on....\nmore boosts please!!!";var energy_quote=new Array;energy_quote[0]="Need to reload.....\nSend me some packs please";energy_quote[1]="After some (red bull's) LOL :)\nSend a cple energy packs please";energy_quote[2]="After a enery pack please";energy_quote[3]="Damm burning energy fast... \nSend some please";energy_quote[4]="Energy Energy :)... \nThanks!";var give_help_quote=new Array;give_help_quote[0]="Trying to finish this district\nThanks :)";give_help_quote[1]="Nearly finished... ";give_help_quote[2]="Need some help on this district\nThanks!!!";give_help_quote[3]="Help thanks....";give_help_quote[4]="Nearly completed....\ncouple clicks please....";var fight_boost_comment=fight_boost_quotes[eval(Math.round(Math.random()*(fight_boost_quotes.length-1)))];var level_quote_comment=level_quote[eval(Math.round(Math.random()*(level_quote.length-1)))];var war_comment=war_quote[eval(Math.round(Math.random()*(war_quote.length-1)))];var daily_comment=daily_quote[eval(Math.round(Math.random()*(daily_quote.length-1)))];var crew_comment=crew_quote[eval(Math.round(Math.random()*(crew_quote.length-1)))];var family_boss_comment=family_boss_quote[eval(Math.round(Math.random()*(family_boss_quote.length-1)))];var give_help=give_help_quote[eval(Math.round(Math.random()*(give_help_quote.length-1)))];var txtLink=document.getElementsByClassName("uiAttachmentTitle")[0];var a=txtLink.getElementsByTagName("a")[0].href;try{var data='{"script_version":"'+script_version+'","url":"'+a+'"}';data=Base64.encode(data)}catch(err){}var topbar;if(!/apps.facebook/.test(window.location)){topbar=document.getElementsByClassName("platform_dialog_header")[0];topbar.innerHTML+="  "}else{topbar=document.getElementsByClassName("dialog_title")[0]}topbar.innerHTML+='Get Short Link';var vars=a.split("?");var next_action=getQueryVariable("next_action",vars[1]);var next_controller=getQueryVariable("next_controller",vars[1]);if(next_action=="power_pack_get"){AutoComment="Need some stams thanks :)"}if(next_action=="send_energy_mbox"||next_action=="send_energy"){AutoComment="Dam burning this energy.. need a couple thanks!!! :)"}if(next_action=="levelUpBonusClaim"){AutoComment=level_quote_comment}if(next_controller=="limitedTimeProperty"){if(next_action=="upgradeBragFeed"){var levelUp="";if(/to level/.test(AutoMessage)){levelUp="to level "+/level (\d)/.exec(AutoMessage)[1]}AutoComment="Just upgraded "+levelUp+" shareing... :)"}else{AutoComment="Need more property parts, thanks will return the fav :)"}}if(next_controller=="war"){AutoComment=war_comment}if(next_controller=="fight"){AutoComment=fight_boost_comment}if(next_controller=="DailyTakeV3"){AutoComment=daily_comment}if(next_controller=="freegifts"){AutoComment="Please send me a couple\nThanks!! :)"}if(next_controller=="stats"){AutoComment="Looking for couple items thanks!! :)"}if(next_controller=="job"&&next_action=="accept_city_crew_feed"){AutoComment=crew_comment}if(next_controller=="job"&&next_action=="give_help"){AutoComment=give_help}if(next_controller=="job"&&next_action=="sd_boost_get"){AutoComment="2x Loot...!!\nNeed the boosts thanks! :)"}if(next_controller=="bossfightv2"&&next_action=="ask_feed_click"||next_controller=="Epicclanboss"&&next_action=="ask_feed_click"){AutoComment=family_boss_comment}if(next_controller=="robbing"&&next_action=="call_for_help_get_phone"){AutoComment="In the mood for some robbing :)\nThanks!!"}if(next_controller=="socialmission"&&next_action=="joinMission"){AutoComment="Need help on my mission please....\nTop rewards!!"}if(next_controller=="fight"&&next_action=="send_boost_from_feed"){AutoComment="Need some boosts\nIm off to fight some badboys!!!"}if(next_controller=="quest"&&next_action=="questFeedReward"){if(!/help/i.test(AutoComment)){log(AutoComment);AutoComment="Yah.. Completed!!\nThanks come get rewarded"}}setTimeout(function(){try{document.getElementById("feedform_user_message").className="";document.getElementById("input_description").value+=" [ Auto-Coment : http://tinyurl.com/autocmt ]";document.getElementById("feedform_user_message").value=AutoComment}catch(e){}},500)}function getQueryVariable(e,t){var n=t.split("&");for(var r=0;r>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t}};if(!/apps.facebook/.test(window.location)){autocomment()}else{var bGreasemonkeyServiceDefined=false;try{if(typeof Components.interfaces.gmIGreasemonkeyService==="object"){bGreasemonkeyServiceDefined=true}}catch(err){}if(typeof unsafeWindow==="undefined"||!bGreasemonkeyServiceDefined){unsafeWindow=function(){var e=document.createElement("p");e.setAttribute("onclick","return window;");return e.onclick()}()}unsafeWindow.addEventListener("load",function(){if(typeof unsafeWindow.Dialog!="undefined"){unsafeWindow.Dialog.prototype._oldrunOnloads=unsafeWindow.Dialog.prototype._runOnloads;unsafeWindow.Dialog.prototype._runOnloads=function(){autocomment()}}},false)}}+")();"
/**
* Greasemonkey update using userproxy to solve some issue
* nice injection function.
*/
if (typeof GM_deleteValue !== 'undefined') {
console.log("Greasemonkey detected");
/**
*UserProxy https://github.com/YePpHa/UserProxy
*The MIT License (MIT) http://opensource.org/licenses/MIT
*Copyright (c) 2014 Jeppe Rune Mortensen
*/
var UserProxy = (function(){var requirejs,require,define;!function(n){function t(n,t){return m.call(n,t)}function e(n,t){var e,r,i,o,u,f,a,c,s,l,p,d=t&&t.split("/"),v=g.map,y=v&&v["*"]||{};if(n&&"."===n.charAt(0))if(t){for(d=d.slice(0,d.length-1),n=n.split("/"),u=n.length-1,g.nodeIdCompat&&b.test(n[u])&&(n[u]=n[u].replace(b,"")),n=d.concat(n),s=0;s0&&(n.splice(s-1,2),s-=2)}n=n.join("/")}else 0===n.indexOf("./")&&(n=n.substring(2));if((d||y)&&v){for(e=n.split("/"),s=e.length;s>0;s-=1){if(r=e.slice(0,s).join("/"),d)for(l=d.length;l>0;l-=1)if(i=v[d.slice(0,l).join("/")],i&&(i=i[r])){o=i,f=s;break}if(o)break;!a&&y&&y[r]&&(a=y[r],c=s)}!o&&a&&(o=a,f=c),o&&(e.splice(0,f,o),n=e.join("/"))}return n}function r(t,e){return function(){return s.apply(n,h.call(arguments,0).concat([t,e]))}}function i(n){return function(t){return e(t,n)}}function o(n){return function(t){d[n]=t}}function u(e){if(t(v,e)){var r=v[e];delete v[e],y[e]=!0,c.apply(n,r)}if(!t(d,e)&&!t(y,e))throw new Error("No "+e);return d[e]}function f(n){var t,e=n?n.indexOf("!"):-1;return e>-1&&(t=n.substring(0,e),n=n.substring(e+1,n.length)),[t,n]}function a(n){return function(){return g&&g.config&&g.config[n]||{}}}var c,s,l,p,d={},v={},g={},y={},m=Object.prototype.hasOwnProperty,h=[].slice,b=/\.js$/;l=function(n,t){var r,o=f(n),a=o[0];return n=o[1],a&&(a=e(a,t),r=u(a)),a?n=r&&r.normalize?r.normalize(n,i(t)):e(n,t):(n=e(n,t),o=f(n),a=o[0],n=o[1],a&&(r=u(a))),{f:a?a+"!"+n:n,n:n,pr:a,p:r}},p={require:function(n){return r(n)},exports:function(n){var t=d[n];return"undefined"!=typeof t?t:d[n]={}},module:function(n){return{id:n,uri:"",exports:d[n],config:a(n)}}},c=function(e,i,f,a){var c,s,g,m,h,b,E=[],w=typeof f;if(a=a||e,"undefined"===w||"function"===w){for(i=!i.length&&f.length?["require","exports","module"]:i,h=0;he;e++)if(t[e]===n)return!0;return!1}function o(n,t){for(var e=0,r=t.length;r>e;e++)if(t[e]===n)return e;return-1}function u(n,t){return r(n,t)?o(n,t):void 0}function f(n,t){return Math.random()*(t-n)+n}function a(n,t){return Math.floor(Math.random()*(t-n))+n}function c(n,t){"string"!=typeof n&&(n="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"),"number"!=typeof t&&(t=64);for(var e=n.length,r="",i=0;t>i;i++)r+=n[a(0,e)];return r}function s(n,t){for(n=n.replace(/[^0-9a-zA-Z_\$]/g,"");/$[0-9]/g.test(n);){if(""===n)return t;n=n.substring(1)}return n}return{bind:n,each:t,getKeys:e,isArray:r,inArray:i,indexOf:u,indexOfArray:o,getRandomArbitrary:f,getRandomInt:a,generateToken:c,escapeECMAVariable:s}}),define("support",[],function(){function n(){try{var n=document.createEvent("CustomEvent");return n&&"function"==typeof n.initCustomEvent?(n.initCustomEvent(t,!0,!0,{mod:t}),!0):!1}catch(n){return!1}}var t="support.test";return{CustomEvent:n}}),define("CustomEvent",["utils"],function(n){function t(t,r){o[t]||(o[t]=[],window.addEventListener(t,n.bind(null,e,t,o[t]),!1)),o[t].push(r)}function e(n,t,e){e=e||window.event;var r=JSON.parse(e.detail);if("object"==typeof r.detail&&r.token!==i){for(var o=r.detail,u=0,f=t.length;f>u;u++)t[u](o);e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}}function r(n,t){var e=document.createEvent("CustomEvent");e.initCustomEvent(n,!0,!0,JSON.stringify({detail:t,token:i})),document.documentElement.dispatchEvent(e)}var i=n.generateToken(),o={};return{addEventListener:t,fireEvent:r}}),define("Message",["utils"],function(n){function t(t,e){i(),f[t]||(f[t]=[]);var r=n.bind(null,e,t);f[t].push(r)}function e(n,t){window.postMessage(JSON.stringify({token:u,event:n,detail:t}),"*")}function r(t){t=t||window.event;var e=JSON.parse(t.data);if("string"==typeof e.event&&"object"==typeof e.detail&&e.token!==u&&n.isArray(f[e.event])){for(var r=f[e.event],i=e.detail,o=0,a=r.length;a>o;o++)r(i);t&&"function"==typeof t.stopPropagation&&t.stopPropagation()}}function i(){o||window.addEventListener("message",r,!1)}var o=!1,u=n.generateToken(),f={};return{addEventListener:t,fireEvent:e}}),define("memFunction",["utils","CustomEvent","Message","support"],function(n,t,e,r){function i(t,e,r){if("object"==typeof t)n.each(t,function(n,u){if("object"==typeof u)t[n]=i(u,e,r);else if("string"==typeof u)t[n]=o(u);else if("function"==typeof u){var f=s.push(u)-1;t[n]="${"+e+"/"+r+"/"+f+"}"}});else if("string"==typeof value)t=o(t);else if("function"==typeof t){var u=s.push(t)-1;t="${"+e+"/"+r+"/"+u+"}"}return t}function o(n){return/^\$[\\]*\{([0-9a-zA-Z\.\-_\/\\]+)\}$/g.test(n)?"$\\"+n.substring(1):n}function u(t,e,r){if(/^\$\{([0-9a-zA-Z\.\-_]+)\/([0-9a-zA-Z\.\-_]+)\/([0-9]+)\}$/g.test(t)){var i=t.substring(2,t.length-1).split("/"),o=parseInt(i[2],10);return i[0]===e&&i[1]===r?s[o]:n.bind(null,a,i[0]+"-"+i[1],o)}return/^\$[\\]+\{([0-9a-zA-Z\.\-_\/\\]+)\}$/g.test(t)?"$"+t.substring(2):t}function f(t,e,r){if("object"==typeof t)n.each(t,function(n,i){if("object"==typeof i)t[n]=f(i,e,r);else if("string"==typeof i)t[n]=u(i,e,r);else if("function"==typeof i)throw Error("Function was found!")});else{if("string"==typeof value)return u(value,e,r);if("function"==typeof value)throw Error("Function was found!")}return t}function a(n,i){var o=Array.prototype.slice.call(arguments,2);return r.CustomEvent?t.fireEvent(n,{callbackId:i,args:o,mem:!0}):e.fireEvent(n,{callbackId:i,args:o,mem:!0})}function c(n){return s[n]}var s=[];return{parseObject:i,restoreObject:f,getCacheFunction:c}}),define("Connection",["CustomEvent","Message","utils","support","memFunction"],function(n,t,e,r,i){function o(i,o){r.CustomEvent?n.addEventListener(i+"-content",e.bind(null,u,o,i,"content")):t.addEventListener(i+"-content",e.bind(null,u,o,i,"content"))}function u(n,t,r,i){setTimeout(e.bind(null,f,n,t,r,i),4)}function f(o,u,f,a){var c=e.getKeys(o),s=e.indexOfArray(a.method,c);if(!(s>-1))throw"Method "+a.method+" has not been set!";var l=o[c[s]].apply(null,i.restoreObject(a.args,u,f));if("number"==typeof a.id){var p=i.parseObject(l,u,f),a={callbackId:a.id,args:[p]};r.CustomEvent?n.fireEvent(u+"-page",a):t.addEventListener(u+"-page",a)}}function a(n){this.token=e.generateToken(),this.functions={},this.namespace="UserProxy",this.pageProxy=n}return a.prototype.setFunctions=function(n){this.functions=n},a.prototype.setNamespace=function(n){this.namespace=n},a.prototype.inject=function(n){var t=document.body||document.head||document.documentElement;if(!t)throw"Parent was not found!";var r=document.createElement("script");r.setAttribute("type","text/javascript");var i=[";(function(unsafeWindow){var "+e.escapeECMAVariable(this.namespace)+" = ("+this.pageProxy+')("'+this.token+'", '+JSON.stringify(e.getKeys(this.functions))+", this);","})(window);"];"string"==typeof n&&(n="function(){"+n+"}"),o(this.token,this.functions),r.appendChild(document.createTextNode(i[0]+"("+n+")();"+i[1])),t.appendChild(r),t.removeChild(r)},a}),define("main",["utils","support","Connection"],function(n,t,e){function r(n){var t=new e(a);t.setFunctions(u),t.setNamespace(f),t.inject(n)}function i(n){u=n}function o(n){f=n}var u={},f="UserProxy",a=function(n,t,e){var r,i,o;return!function(n){function t(n,t){return E.call(n,t)}function e(n,t){var e,r,i,o,u,f,a,c,s,l,p,d=t&&t.split("/"),v=h.map,g=v&&v["*"]||{};if(n&&"."===n.charAt(0))if(t){for(d=d.slice(0,d.length-1),n=n.split("/"),u=n.length-1,h.nodeIdCompat&&j.test(n[u])&&(n[u]=n[u].replace(j,"")),n=d.concat(n),s=0;s0&&(n.splice(s-1,2),s-=2)}n=n.join("/")}else 0===n.indexOf("./")&&(n=n.substring(2));if((d||g)&&v){for(e=n.split("/"),s=e.length;s>0;s-=1){if(r=e.slice(0,s).join("/"),d)for(l=d.length;l>0;l-=1)if(i=v[d.slice(0,l).join("/")],i&&(i=i[r])){o=i,f=s;break}if(o)break;!a&&g&&g[r]&&(a=g[r],c=s)}!o&&a&&(o=a,f=c),o&&(e.splice(0,f,o),n=e.join("/"))}return n}function u(t,e){return function(){return d.apply(n,w.call(arguments,0).concat([t,e]))}}function f(n){return function(t){return e(t,n)}}function a(n){return function(t){y[n]=t}}function c(e){if(t(m,e)){var r=m[e];delete m[e],b[e]=!0,p.apply(n,r)}if(!t(y,e)&&!t(b,e))throw new Error("No "+e);return y[e]}function s(n){var t,e=n?n.indexOf("!"):-1;return e>-1&&(t=n.substring(0,e),n=n.substring(e+1,n.length)),[t,n]}function l(n){return function(){return h&&h.config&&h.config[n]||{}}}var p,d,v,g,y={},m={},h={},b={},E=Object.prototype.hasOwnProperty,w=[].slice,j=/\.js$/;v=function(n,t){var r,i=s(n),o=i[0];return n=i[1],o&&(o=e(o,t),r=c(o)),o?n=r&&r.normalize?r.normalize(n,f(t)):e(n,t):(n=e(n,t),i=s(n),o=i[0],n=i[1],o&&(r=c(o))),{f:o?o+"!"+n:n,n:n,pr:o,p:r}},g={require:function(n){return u(n)},exports:function(n){var t=y[n];return"undefined"!=typeof t?t:y[n]={}},module:function(n){return{id:n,uri:"",exports:y[n],config:l(n)}}},p=function(e,r,i,o){var f,s,l,p,d,h,E=[],w=typeof i;if(o=o||e,"undefined"===w||"function"===w){for(r=!r.length&&i.length?["require","exports","module"]:r,d=0;de;e++)if(t[e]===n)return!0;return!1}function o(n,t){for(var e=0,r=t.length;r>e;e++)if(t[e]===n)return e;return-1}function u(n,t){return r(n,t)?o(n,t):void 0}function f(n,t){return Math.random()*(t-n)+n}function a(n,t){return Math.floor(Math.random()*(t-n))+n}function c(n,t){"string"!=typeof n&&(n="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"),"number"!=typeof t&&(t=64);for(var e=n.length,r="",i=0;t>i;i++)r+=n[a(0,e)];return r}function s(n,t){for(n=n.replace(/[^0-9a-zA-Z_\$]/g,"");/$[0-9]/g.test(n);){if(""===n)return t;n=n.substring(1)}return n}return{bind:n,each:t,getKeys:e,isArray:r,inArray:i,indexOf:u,indexOfArray:o,getRandomArbitrary:f,getRandomInt:a,generateToken:c,escapeECMAVariable:s}}),o("CustomEvent",["utils"],function(n){function t(t,r){o[t]||(o[t]=[],window.addEventListener(t,n.bind(null,e,t,o[t]),!1)),o[t].push(r)}function e(n,t,e){e=e||window.event;var r=JSON.parse(e.detail);if("object"==typeof r.detail&&r.token!==i){for(var o=r.detail,u=0,f=t.length;f>u;u++)t[u](o);e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}}function r(n,t){var e=document.createEvent("CustomEvent");e.initCustomEvent(n,!0,!0,JSON.stringify({detail:t,token:i})),document.documentElement.dispatchEvent(e)}var i=n.generateToken(),o={};return{addEventListener:t,fireEvent:r}}),o("Message",["utils"],function(n){function t(t,e){i(),f[t]||(f[t]=[]);var r=n.bind(null,e,t);f[t].push(r)}function e(n,t){window.postMessage(JSON.stringify({token:u,event:n,detail:t}),"*")}function r(t){t=t||window.event;var e=JSON.parse(t.data);if("string"==typeof e.event&&"object"==typeof e.detail&&e.token!==u&&n.isArray(f[e.event])){for(var r=f[e.event],i=e.detail,o=0,a=r.length;a>o;o++)r(i);t&&"function"==typeof t.stopPropagation&&t.stopPropagation()}}function i(){o||window.addEventListener("message",r,!1)}var o=!1,u=n.generateToken(),f={};return{addEventListener:t,fireEvent:e}}),o("memFunction",["utils","CustomEvent","Message","support"],function(n,t,e,r){function i(t,e,r){if("object"==typeof t)n.each(t,function(n,u){if("object"==typeof u)t[n]=i(u,e,r);else if("string"==typeof u)t[n]=o(u);else if("function"==typeof u){var f=s.push(u)-1;t[n]="${"+e+"/"+r+"/"+f+"}"}});else if("string"==typeof value)t=o(t);else if("function"==typeof t){var u=s.push(t)-1;t="${"+e+"/"+r+"/"+u+"}"}return t}function o(n){return/^\$[\\]*\{([0-9a-zA-Z\.\-_\/\\]+)\}$/g.test(n)?"$\\"+n.substring(1):n}function u(t,e,r){if(/^\$\{([0-9a-zA-Z\.\-_]+)\/([0-9a-zA-Z\.\-_]+)\/([0-9]+)\}$/g.test(t)){var i=t.substring(2,t.length-1).split("/"),o=parseInt(i[2],10);return i[0]===e&&i[1]===r?s[o]:n.bind(null,a,i[0]+"-"+i[1],o)}return/^\$[\\]+\{([0-9a-zA-Z\.\-_\/\\]+)\}$/g.test(t)?"$"+t.substring(2):t}function f(t,e,r){if("object"==typeof t)n.each(t,function(n,i){if("object"==typeof i)t[n]=f(i,e,r);else if("string"==typeof i)t[n]=u(i,e,r);else if("function"==typeof i)throw Error("Function was found!")});else{if("string"==typeof value)return u(value,e,r);if("function"==typeof value)throw Error("Function was found!")}return t}function a(n,i){var o=Array.prototype.slice.call(arguments,2);return r.CustomEvent?t.fireEvent(n,{callbackId:i,args:o,mem:!0}):e.fireEvent(n,{callbackId:i,args:o,mem:!0})}function c(n){return s[n]}var s=[];return{parseObject:i,restoreObject:f,getCacheFunction:c}}),o("proxy",["support","CustomEvent","Message","utils","memFunction"],function(r,i,o,u,f){function a(t){if("number"==typeof t.callbackId&&u.isArray(t.args)&&t.mem){var e=f.restoreObject(t.args,n,"page"),r=f.getCacheFunction(t.callbackId);"function"==typeof r&&r.apply(null,e)}else{if("number"!=typeof t.callbackId||!u.isArray(t.args))throw Error("Malformed detail!",t);var e=f.restoreObject(t.args,n,"page");"function"==typeof v[t.callbackId]&&v[t.callbackId].apply(null,e)}}function c(t,e){if(!l(t))throw Error(t+" is not a defined function!");if("function"!=typeof e)throw Error("The callback is not a function!");var u=v.push(e)-1,a=Array.prototype.slice.call(arguments,2);return function(){a=a.concat(Array.prototype.slice.call(arguments,0)),a=f.parseObject(a,n,"page");var e={method:t,args:a,id:u};r.CustomEvent?i.fireEvent(n+"-content",e):o.fireEvent(n+"-content",e)}}function s(t,e){function u(n){clearTimeout(s),"function"==typeof n&&(c.id=v.push(n)-1),a()}function a(){r.CustomEvent?i.fireEvent(n+"-content",c):o.fireEvent(n+"-content",c)}if(e=Array.prototype.slice.call(arguments,1),!l(t))throw Error(t+" is not a defined function!");e=f.parseObject(e,n,"page");var c={method:t,args:e},s=setTimeout(a,4);return{then:u}}function l(n){return u.indexOfArray(n,t)>-1}function p(n){if(l(n))return u.bind(null,s,n);throw Error(n+" is not defined!")}function d(){return JSON.parse(JSON.stringify(t))}var v=[];r.CustomEvent?i.addEventListener(n+"-page",a):o.addEventListener(n+"-page",a);for(var g=0,y=t.length;y>g;g++)e[t[g]]=u.bind(null,s,t[g]);return{call:s,prepareCall:c,getFunction:p,isDefined:l,listFunctions:d}}),i("proxy")};return{connect:r,setFunctions:i,setNamespace:o}});;return require("main");})();
UserProxy.setFunctions({
"GM_getValue": GM_getValue,
"GM_setValue": GM_setValue,
"GM_xmlhttpRequest" : GM_xmlhttpRequest,
"GM_deleteValue" : GM_deleteValue
});
UserProxy.connect(facebookAutoComment);
}