Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Atelier 801 Account Manager
- // @description Allows you to go in any account you have in anytime at Atelier 801.
- // @match http://atelier801.com/*
- // @grant none
- // ==/UserScript==
- var dC={gI:function(e){return e?decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null:null},sI:function(e,n,o,t,r,c){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;var s="";if(o)switch(o.constructor){case Number:s=o===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+o;break;case String:s="; expires="+o;break;case Date:s="; expires="+o.toUTCString()}return document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(n)+s+(r?"; domain="+r:"")+(t?"; path="+t:"")+(c?"; secure":""),!0},rI:function(e,n,o){return this.hI(e)?(document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(o?"; domain="+o:"")+(n?"; path="+n:""),!0):!1},hI:function(e){return e?new RegExp("(?:^|;\\s*)"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(document.cookie):!1},k:function(){for(var e=document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g,"").split(/\s*(?:\=[^;]*)?;\s*/),n=e.length,o=0;n>o;o++)e[o]=decodeURIComponent(e[o]);return e}};
- (function(){
- 'use strict';
- var MyAccounts={
- "MyAccount":"Password",
- "MyAccount2":"Password",
- },MEM=[[],[]];
- String.prototype.rA=function(a,b){
- return this.split(a).join(b)
- },
- String.prototype.bT=function(a,b){
- MEM[0][0]=this.substring(this.indexOf(a)+a.length);
- return MEM[0][0].substring(0,MEM[0][0].indexOf(b))
- };
- function BTNs(){
- var r=(document.getElementById("identification")||document.getElementById("barre_navigation").getElementsByClassName("dropdown")[0]).parentElement;
- for(var i in MyAccounts)
- !function(i){
- var n=document.createElement("button")
- n.setAttribute("class","btn"),
- n.setAttribute("data-acc",i),
- n.style.marginRight="4px",
- n.onclick=function(){SIGN_IN(this.getAttribute("data-acc"))},
- n.innerHTML=i;
- r.appendChild(n);
- n=null
- }(i);
- r=null
- }
- BTNs();
- if(dC.hI("nextlogin")){
- MEM[1][0]=document.cookie.bT("nextlogin=",";");
- //document.cookie.replace("nextlogin"+MEM[1][0]+";","");
- dC.rI("nextlogin");
- SIGN_IN(MEM[1][0])
- }
- function SIGN_IN(a){
- MEM[0][1]=document.cookie.bT('login=',';');
- if(typeof MEM[0][1]=="string"&&MEM[0][1].length>0&&MEM[0][1]!='""'){
- MEM[0][3]=!!document.querySelector("form[action=deconnexion]")?document.querySelector("form[action=deconnexion]").querySelector("button"):null;
- if(!!MEM[0][3]){
- //MEM[0][2]=document.cookie.length;
- //document.cookie=document.cookie+(document.cookie.substring(MEM[0][2]-1,MEM[0][2])==";"?"nextlogin="+a+";":";nextlogin="+a+";");
- dC.sI("nextlogin",a);
- MEM[0][3].click()
- }
- }else{
- document.querySelector("#auth_login_1").value=a,
- document.querySelector("#auth_pass_1").value=MyAccounts[a];
- auth({"preventDefault":function(){}})
- }
- }
- }())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement