Advertisement
URBAN420NETWORK

instant frontpage

Dec 13th, 2016
981
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var items = document.getElementsByClassName("hlist games game-cards")[0];
  2. var popularGames = [];
  3. var token = prompt("Please enter your Discord token");
  4. var promote = function (placeId, playerCount) {
  5.     var http = new XMLHttpRequest();
  6.     http.open('POST', 'https://discordapp.com/api/channels/254749223143211010/messages');
  7.     http.setRequestHeader("Content-type", "application/json");
  8.     http.setRequestHeader("authorization", token);
  9.     http.send('{"content":"pls join this roblox place that i made, id: ' + placeId + ' playing: ' + playerCount + ' join !!"}');
  10. }
  11. if (token.indexOf('.') < 5)
  12.     alert("Invalid token. Please run the script again");
  13. else {
  14.     var ws = new WebSocket("wss://gateway.discord.gg/?v=5&encoding=json");
  15.     var seq = null;
  16.     ws.onmessage = function (r) {
  17.         var e = JSON.parse(r.data);
  18.         if (typeof (e.s) != 'undefined' && e.s != null)
  19.             seq = e.s;
  20.         if (e.op == 10) {
  21.             setInterval(function () {
  22.                 ws.send(JSON.stringify({
  23.                     "op": 1,
  24.                     "d": seq
  25.                 }));
  26.             }, e.d.heartbeat_interval);
  27.             ws.send(JSON.stringify({
  28.                 "op": 2,
  29.                 "d": {
  30.                     "token": token,
  31.                     "properties": {
  32.                         "$os": "linux",
  33.                         "$browser": "discord.py",
  34.                         "$device": "discord.py",
  35.                         "$referrer": "",
  36.                         "$referring_domain": ""
  37.                     },
  38.                     "compress": true,
  39.                     "large_threshold": 250,
  40.                     "v": 3
  41.                 }
  42.             }));
  43.         }
  44.         if (e.t == "MESSAGE_CREATE") {
  45.             console.log("message created");
  46.             if (e.d.channel_id.toString() == "254749223143211010") {
  47.                 console.log("in #chat (" + e.d.content + ") and " + e.d.content.startsWith('pls join this roblox place that i made, id: '));
  48.                 if (e.d.content.startsWith('pls join this roblox place that i made, id: ')) {
  49.                     var contentData = e.d.content.split(' ');
  50.                     var placeId = parseInt(contentData[9]);
  51.                     var playerCount = parseInt(contentData[11]);
  52.  
  53.                     $.get("https://www.roblox.com/place-thumbnails?params=%5B%7BplaceId:" + placeId + "%7D%5D", function (response) {
  54.                         var placeData = response[0];
  55.                         items.innerHTML = atob('PGxpIGNsYXNzPSJsaXN0LWl0ZW0gZ2FtZS1jYXJkIj4NCiAgICA8ZGl2IGNsYXNzPSJnYW1lLWNhcmQtY29udGFpbmVyIj4NCiAgICAgICAgPGEgaHJlZj0iJUdBTUVVUkwlIiBjbGFzcz0iZ2FtZS1jYXJkLWxpbmsiPg0KICAgICAgICAgICAgPGRpdiBjbGFzcz0iZ2FtZS1jYXJkLXRodW1iLWNvbnRhaW5lciI+DQogICAgICAgICAgICAgICAgPGltZyBjbGFzcz0iZ2FtZS1jYXJkLXRodW1iIiBzcmM9IiVHQU1FVEhVTUIlIiBhbHQ9IiVHQU1FVElUTEUlIj4NCiAgICAgICAgICAgIDwvZGl2Pg0KICAgICAgICAgICAgPGRpdiBjbGFzcz0idGV4dC1vdmVyZmxvdyBnYW1lLWNhcmQtbmFtZSIgdGl0bGU9IiVHQU1FVElUTEUlIiBuZy1ub24tYmluZGFibGU9IiI+DQogICAgICAgICAgICAgICAgJUdBTUVUSVRMRSUNCiAgICAgICAgICAgIDwvZGl2Pg0KICAgICAgICAgICAgPGRpdiBjbGFzcz0iZ2FtZS1jYXJkLW5hbWUtc2Vjb25kYXJ5Ij4NCiAgICAgICAgICAgICAgICAlUExBWUlORyUgUGxheWluZw0KICAgICAgICAgICAgPC9kaXY+DQogICAgICAgICAgICA8ZGl2IGNsYXNzPSJnYW1lLWNhcmQtdm90ZSI+DQogICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0idm90ZS1iYXIiIGRhdGEtdm90aW5nLXByb2Nlc3NlZD0idHJ1ZSI+DQogICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InZvdGUtdGh1bWJzLXVwIj4NCiAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPSJpY29uLXRodW1icy11cCI+PC9zcGFuPg0KICAgICAgICAgICAgICAgICAgICA8L2Rpdj4NCiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0idm90ZS1jb250YWluZXIiIGRhdGEtdXB2b3Rlcz0iMjU5NzI4IiBkYXRhLWRvd252b3Rlcz0iMTg4MzAiPg0KICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0idm90ZS1iYWNrZ3JvdW5kICBoYXMtdm90ZXMiPjwvZGl2Pg0KICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0idm90ZS1wZXJjZW50YWdlIiBzdHlsZT0id2lkdGg6IDkzJTsiPjwvZGl2Pg0KICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0idm90ZS1tYXNrIj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJzZWdtZW50IHNlZy0xIj48L2Rpdj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJzZWdtZW50IHNlZy0yIj48L2Rpdj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJzZWdtZW50IHNlZy0zIj48L2Rpdj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJzZWdtZW50IHNlZy00Ij48L2Rpdj4NCiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2Pg0KICAgICAgICAgICAgICAgICAgICA8L2Rpdj4NCiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0idm90ZS10aHVtYnMtZG93biI+DQogICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz0iaWNvbi10aHVtYnMtZG93biI+PC9zcGFuPg0KICAgICAgICAgICAgICAgICAgICA8L2Rpdj4NCiAgICAgICAgICAgICAgICA8L2Rpdj4NCiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJ2b3RlLWNvdW50cyI+DQogICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InZvdGUtZG93bi1jb3VudCI+MTgsODMwPC9kaXY+DQogICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InZvdGUtdXAtY291bnQiPjI1OSw3Mjg8L2Rpdj4NCiAgICAgICAgICAgICAgICA8L2Rpdj4NCiAgICAgICAgICAgIDwvZGl2Pg0KICAgICAgICA8L2E+DQogICAgPC9kaXY+DQo8L2xpPg==')
  56.                                             .replace(/%GAMEURL%/g, placeData.url)
  57.                                             .replace(/%GAMETHUMB%/g, placeData.thumbnailUrl)
  58.                                             .replace(/%GAMETITLE%/g, placeData.name)
  59.                                             .replace(/%PLAYING%/g, playerCount.toLocaleString())
  60.                                             + items.innerHTML;
  61.                     });
  62.                 }
  63.             }
  64.         }
  65.     };
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement