Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var aing={
- gid:"199855813453158",
- email:"kjkjkjkjk@ymail.com",
- password:"password",
- getApi:function(huh){var a=UrlFetchApp.fetch(huh,{muteHttpExceptions:true,method:"get"}),b=JSON.parse(a.getContentText());return b},
- setApi:function(huh,pl){var a=UrlFetchApp.fetch(huh,{muteHttpExceptions:true,method:"post",payload:pl}),b=JSON.parse(a.getContentText());return b},
- sp:PropertiesService.getScriptProperties(),
- saveMultipleDb:function(what,s){if(!s){s="uid"}var a={};for(x in what){if(what[x].id){a[s+"_"+what[x].id]=JSON.stringify(what[x])}}aing.sp.setProperties(a,false)},
- saveDb:function(what,s){if(!s){s="uid"}if(what.id){aing.sp.setProperty(s+"_"+what.id,JSON.stringify(what))}},
- getDb:function(what,s){if(!s){s="uid"}if(what){var a=aing.sp.getProperty(s+"_"+what);if(a){return JSON.parse(a)}else{return false}}else{var a=aing.sp.getProperties(),b=[];for(x in a){if(a[x]&&x.match(s+"_")){b.push(JSON.parse(a[x]))}}if(b.length==0){return b}else{return b.sort(function(c,d){if(d.time){return d.time.localeCompare(c.time)}})}}},
- delDb:function(what,s){if(!s){s="uid"}aing.sp.deleteProperty(s+"_"+what)},
- delAllDb:function(){aing.sp.deleteAllProperties()},
- login:function(imel,paswot){
- aing.user={"email":imel,"pass":paswot,"login":"Log+In"};
- var a=UrlFetchApp.fetch("https://m.facebook.com/login.php",{"method":"POST","payload":aing.user,"followRedirects":false}).getAllHeaders()['Set-Cookie'];
- for(x in a){if(a[x].match(/c_user/i)){aing.user.kuki=a.join(";");aing.user.id=a[x].match(/c_user=(\d+)/)[1];break}}
- if(aing.user.kuki&&aing.user.id){
- Logger.log("Logging succeed uid:"+aing.user.id);
- var b=UrlFetchApp.fetch("https://m.facebook.com/home.php",{"method":"GET","headers":{"Cookie":aing.user.kuki}}).getContentText().match(/<input (.*?) \/\>/gi);
- for(y in b){if(/ name=\"fb_dtsg\" /i.exec(b[y])&&/ value=\"(.*?)\" /.exec(b[y])){aing.user.dtsg=/ value=\"(.*?)\" /.exec(b[y])[1];break}}
- if(aing.user.dtsg){
- aing.saveDb(aing.user);
- }
- Logger.log("fb_dtsg: "+aing.user.dtsg);
- }else{
- Logger.log("Logging failed!\n"+JSON.stringify(a,null," "));
- }
- },
- getRequests:function(){
- Logger.log("Collecting requests..");
- var bb=UrlFetchApp.fetch("https://m.facebook.com/groups/"+aing.gid+"/madminpanel/requests/",{"method":"GET","headers":{"Cookie":aing.user.kuki}}).getContentText();
- var b=bb.match(/<input (.*?) \/\>/gi);
- var masukga="ga";
- var g=/<title>(.*?)<\/title>/i.exec(bb);
- if(g&&g[1]){Logger.log(g[1])}
- for(y in b){
- if(/ name=\"fb_dtsg\" /i.exec(b[y])&&/ value=\"(.*?)\" /.exec(b[y])){
- aing.user.dtsg=/ value=\"(.*?)\" /.exec(b[y])[1];
- aing.saveDb(aing.user);
- masukga="ya";
- break;
- }
- }
- if(masukga=="ya"){
- var f=/<span class=\"mfsm fcg\">(.*?)<\/span>/i.exec(bb);
- if(f&&f[1]){Logger.log(f[1])}
- for(z in b){
- if(/ name=\"userid\" /i.exec(b[z])&&/ value=\"(.*?)\" /.exec(b[z])){
- var c=/ value=\"(.*?)\" /.exec(b[z])[1];
- if(c){
- Logger.log("Confirming "+c);
- var d=UrlFetchApp.fetch("https://m.facebook.com/groups/"+aing.gid+"/write_async/requests/",{"method":"POST","headers":{"Cookie":aing.user.kuki},"payload":{"fb_dtsg":aing.user.dtsg,"userid":c,"charset_test":"€,´,€,´,水,Д,Є","add":1}}).getContentText();
- var e=/<div class=\"_55wr acy\">(.*?)<\/div>/i.exec(d);
- if(e&&e[1]){Logger.log(e[1])}
- break;
- }
- }
- }
- }else{
- Logger.log("Not logged-in!");
- aing.delDb(aing.user.id);
- }
- }
- };
- function confirmMembers(){
- var a=aing.getDb();
- if(a.length==0){
- aing.login(aing.email,aing.password);
- }else{
- aing.user=a[0];
- aing.getRequests();
- }
- }
Add Comment
Please, Sign In to add comment