call23re

Remove From Collections

Feb 19th, 2018
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Removes specified item from collections. This may not update instantly. This can be used through the chrome developer console.
  2.  
  3. let id = 1028826; // ID of item you want to remove.
  4.  
  5. let form = new FormData();
  6. form.append('assetId', id);
  7. form.append('addToProfile', false);
  8.  
  9. function getToken() {
  10.     return new Promise((resolve, reject) => {
  11.         fetch('https://www.roblox.com/catalog/meta-data', {
  12.             credentials: 'include'
  13.         })
  14.         .then((resp) => resp.json()).then(function(data) {
  15.             resolve(data.XsrfToken);
  16.         }).catch(function() {
  17.           reject();  
  18.         });
  19.     });
  20. };
  21.  
  22. async function remove() {
  23.     let token = await getToken();
  24.     fetch('https://www.roblox.com/asset/toggle-profile', {
  25.         credentials: 'include',
  26.         method: 'POST',
  27.         body: form,
  28.         headers: {
  29.             'X-CSRF-TOKEN': token
  30.         }
  31.     });
  32. };
  33.  
  34. remove();
Advertisement
Add Comment
Please, Sign In to add comment