Advertisement
StefanBashkir

ROBLOX Update Item

Apr 17th, 2016
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var tags = "Test desc";
  2. var on = "on";
  3.  
  4. function edit(id, name) {
  5.     $.get("https://www.roblox.com/item.aspx?id=" + id).success(function(data) {
  6.         var ET      = "ctl00$cphRoblox$SubmitButtonTop";
  7.         var EA      = "";
  8.         var VS      = $("#__VIEWSTATE", data).val();
  9.         var VSG     = $("#__VIEWSTATEGENERATOR", data).val();
  10.         var EV      = $("#__EVENTVALIDATION", data).val();
  11.         var PP      = $("#__PREVIOUSPAGE", data).val()
  12.         var Data = {
  13.             __EVENTTARGET : encodeURIComponent(ET),
  14.             __EVENTARGUMENT : "",
  15.             __VIEWSTATE : encodeURIComponent(VS),
  16.             __VIEWSTATEGENERATOR : encodeURIComponent(VSG),
  17.             __PREVIOUSPAGE : PP  == "undefined" ? "" : PP,
  18.             __EVENTVALIDATION : encodeURIComponent(EV)
  19.         }
  20.         Data[encodeURIComponent("ctl00$cphRoblox$NameTextBox")] = encodeURIComponent("Name should change to this?")
  21.         Data[encodeURIComponent("ctl00$cphRoblox$EnableCommentsCheckBox")] = "on"
  22.         Data[encodeURIComponent("GenreButtons2")] = 1
  23.         Data[encodeURIComponent("ctl00$cphRoblox$actualGenreSelection")] = 1
  24.         Data[encodeURIComponent("ctl00$cphRoblox$DescriptionTextBox")] = encodeURIComponent(tags)
  25.         Data[encodeURIComponent("ctl00$cphRoblox$RobuxPrice")] = ""
  26.         var Request = new XMLHttpRequest();
  27.         var ParamString = "";
  28.         Request.open("POST", "https://www.roblox.com/my/item.aspx?id=" + id, true);
  29.         Request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
  30.         Request.setRequestHeader("Cache-Control", "max-age=0");
  31.         Request.setRequestHeader("Upgrade-Insecure-Requests", "1");
  32.         Request.setRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
  33.         $.each(Data, function(Key, Value){
  34.             ParamString = ParamString + Key + "=" + Value + "&";
  35.         });
  36.         ParamString = ParamString.substr(0, ParamString.length-1); // Removes trailing "&"
  37.         Request.send(ParamString);
  38.         console.log("Edited successfully.");
  39.     });
  40.  
  41. }
  42.  
  43. function loop(page) {
  44.     $.get("https://search.roblox.com/catalog/json?Subcategory=1&CreatorID=62277089&CurrencyType=0&pxMin=0&pxMax=0&SortType=3&SortAggregation=5&SortCurrency=0&IncludeNotForSale=true&LegendExpanded=false&Category=1&PageNumber=" + page).success(function(data) {
  45.         console.log("On page: " + page);
  46.         for (var i = 0; i < data.length; i++) {
  47.             edit(data[i].AssetId, data[i].Name);
  48.         }
  49.     });
  50. }
  51.  
  52. /*for (var i = 0; i < 15; i++) {
  53.     loop(i);
  54. }*/
  55. edit(183609406, "0003830056_21")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement