Free javascript Hosting


invitealltimmccoolfollowers.js

Uploaded on Mar 16 2022 08:00 by prestondonut340

{
0: "x = document.createElement(\"script\");,
1: "x.src = \"//ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js\";,
2: "void document.getElementsByTagName(\"head\")[0].appendChild(x);,
3: "",
4: "",
5: "var User = document.getElementsByClassName('ignore-react-onclickoutside user-info')[0].children[1].textContent;",
6: "var NumberOfPages = 0;",
7: "var NumStart = 0;",
8: "var page = 1;",
9: "var followers = [];",
10: "var Numbersend = 0;",
11: "",
12: "function getCookie(cname) {",
13: "let name = cname + \"=\";,
14: "let decodedCookie = decodeURIComponent(document.cookie);",
15: "let ca = decodedCookie.split(';');",
16: "for (let i = 0; i < ca.length; i++) {",
17: "let c = ca[i];",
18: "while (c.charAt(0) == ' ') {",
19: "c = c.substring(1);",
20: "}",
21: "if (c.indexOf(name) == 0) {",
22: "return c.substring(name.length, c.length);",
23: "}",
24: "}",
25: "return \"\";,
26: "}",
27: "",
28: "function getData() {",
29: "if (window.jQuery) {",
30: "if (NumberOfPages == 0) {",
31: "window.jQuery.ajax({",
32: "url: 'https://scratch.mit.edu/users/TimMcCool/followers/?page=' + page,",
33: "success: function(data, status) {",
34: "var $dom = window.jQuery(data);",
35: "var $users = $dom.find('span.title').children();",
36: "var $out = $('#result');",
37: "for (var i = 0; i < $users.length; i += 1) {",
38: "var user = $users[i].text.trim();",
39: "followers.push(user)",
40: "}",
41: "page += 1;",
42: "document.getElementById('console').innerHTML = 'loaded page ' + page;",
43: "getData()",
44: "},",
45: "error: function(jqXHR, textStatus, errorThrown) {",
46: "NumberOfPages = 1;",
47: "alert(\"Starting to send invites!\");,
48: "page += 1;",
49: "console.log(page);",
50: "getData()",
51: "}",
52: "})",
53: "} else {",
54: "var addUser = followers[Numbersend + NumStart];",
55: "window.jQuery.ajax({",
56: "url: 'https://scratch.mit.edu/site-api/users/curators-in/' + StudioNum + '/invite_curator/?usernames=' + addUser,",
57: "Connection: close,",
58: "type: 'PUT',",
59: "headers: {",
60: "\"X-Requested-With\": 'XMLHttpRequest',,
61: "\"X-CSRFToken\": getCookie('scratchcsrftoken'),,
62: "},",
63: "success: function() {",
64: "if ((Numbersend + NumStart) < followers.length) {",
65: "Numbersend += 1;",
66: "document.getElementById('console').innerHTML = 'sent to(' + Numbersend + ' out of ' + followers.length + ')';",
67: "",
68: "console.log(Numbersend + NumStart);",
69: "setTimeout(() => getData(), 1000)",
70: "} else {",
71: "alert(\"Done!\"),
72: "}",
73: "},",
74: "error: function() {",
75: "if ((Numbersend + NumStart) < followers.length) {",
76: "Numbersend += 1;",
77: "document.getElementById('console').innerHTML = 'sent to(' + Numbersend + ' out of ' + followers.length + ')';",
78: "setTimeout(() => getData(), 1000)",
79: "} else {",
80: "alert(\"Done!\"),
81: "}",
82: "}",
83: "})",
84: "}",
85: "} else {",
86: "setTimeout(function() {",
87: "getData()",
88: "}, 10);",
89: "}",
90: "}",
91: "",
92: "",
93: "",
94: "var StudioNum = location.pathname;",
95: "StudioNum = StudioNum.slice(9, 17);",
96: "if (parseInt(StudioNum)) {",
97: "document.body.innerHTML = \"<div id='console' style='color:#fff;font-family: Arial;'></div>\";,
98: "getData();",
99: "} else {",
100: "alert('Please Run This Script In The Studio That You Want To Send Your Invites In.');",
101: "}"
}

Back to list