// ==UserScript== // @name Wall Manager Sidekick (Pot Farm) // @namespace Wall Manager Sidekick (Pot Farm) // @description Assists Wall Manager with Pot Farm posts // @exclude *apps.facebook.com/mypotfarm/* // @include http*://thepotfarmgame.com/* // @include http*://www.thepotfarmgame.com/* // @include http*://www.facebook.com/pages/FB-Wall-Manager/* // @license http://creativecommons.org/licenses/by-nc-nd/3.0/us/ // @version 0.0.5 // @copyright Itshadow // @downloadURL https://update.greasyfork.icu/scripts/5334/Wall%20Manager%20Sidekick%20%28Pot%20Farm%29.user.js // @updateURL https://update.greasyfork.icu/scripts/5334/Wall%20Manager%20Sidekick%20%28Pot%20Farm%29.meta.js // ==/UserScript== (function() { // @require http://sizzlemctwizzle.com/updater.php?id=119887&days=1 // Modified by Merricksdad 12/13/2013 // *include secure browsing addresses (now required on most facebook servers) // *removed sizzle's updater reference // *replaced trackback address of appcenter to reqs page // Update date: 11-03-12 @ 01:55PM var version = "0.0.4";// Update date: 05-10-13 @ 04:20PM var thisAppID = "272810543124"; var defaultTO=null; function $(ID,root) {return (root||document).getElementById(ID);} String.prototype.startsWith = function(s) {return (this.match("^"+s)==s)}; String.prototype.endsWith = function(s) {return (this.match(s+"$")==s)}; String.prototype.find = function(s) {return (this.indexOf(s) != -1);}; String.prototype.contains = function(s) {return (this.indexOf(s) != -1);}; String.prototype.noSpaces = function(s) {return (this.replace(/\s+/g,''));}; String.prototype.upperWords = function(s) {return (this+'').replace(/^(.)|\s(.)/g, function($1){return $1.toUpperCase();});}; Array.prototype.swap = function (x,y) {var b = this[x];this[x] = this[y];this[y] = b;return this;}; Array.prototype.inArray = function(value) {for(var i=this.length-1; i>=0; i--) {if(this[i]==value) return true;} return false;}; String.prototype.safeContent = function(src){ return src.replace(new RegExp("()-->)|(<[ \n\r]*style[^>]*>.*?<[ \n\r]*/style[^>]*>)|(<[ \n\r]*script[^>]*>.*?<[ \n\r]*/script[^>]*>)|(<(?:.|\s)*?>)", 'gi'),''); } //sorts an array in such a way as to prevent //finding pea before peanut, or pea before english pea, and then effectively swapping their order //now also finds ash in cashew and places ash after cashew Array.prototype.fixOrder = function(){ if (this.length>1) for (var i=this.length-1;i>0;i--) { for (var i2=i-1;i2>0;i2--){ if (this[i].toLowerCase().contains(this[i2].toLowerCase())){ var b=this[i]; this[i]=this[i2]; this[i2]=b; b=null; } } } return this; }; //reconstruct an array, turning it into definitions using a prefix Array.prototype.toDefinitions = function(prefix){ if (this) for (var i=0;(this[i]);i++) this[i]=prefix+this[i].noSpaces().toLowerCase(); return this; }; //returns the merge of any number of JSON objects //pass JSON objects as comma separated parameters //var newJSON = mergeJSON(a,b,c...n) //note: overwrites preexisting entries from earlier passed objects function mergeJSON () { var ret = {}; for (var a=0,len=arguments.length;a