Steam Community - All Greenlight Items Voter

Votes yes or no to all greenlight items (you can set your own filters)

  1. // ==UserScript==
  2. // @name Steam Community - All Greenlight Items Voter
  3. // @namespace Royalgamer06
  4. // @version 1.0.0
  5. // @description Votes yes or no to all greenlight items (you can set your own filters)
  6. // @author Royalgamer06
  7. // @include *://steamcommunity.com/workshop/browse/?appid=*
  8. // @grant none
  9. // @require http://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.js
  10. // ==/UserScript==
  11.  
  12. this.$ = this.jQuery = jQuery.noConflict(true);
  13. $(document).ready(function() {
  14. var html = '<div class="rightSectionTopTitle">Greenlight Items:</div> <div class="rightDetailsBlock"> <div style="position:relative;"> <img class="browseOptionImage" src="http://steamcommunity-a.akamaihd.net/public/images/sharedfiles/filterselect_blue.png?v=1"> <div class="browseOption mostrecent"><a id="allyes">Vote All Yes</a></div> </div> <div style="position:relative;"> <img class="browseOptionImage" src="http://steamcommunity-a.akamaihd.net/public/images/sharedfiles/filterselect_blue.png?v=1"> <div class="browseOption mostrecent"><a id="allno">Vote All No</a></div> </div><hr> </div> </div>';
  15. $(".panel:first").prepend(html);
  16. $("#allyes").click(function() { voteAll("voteup"); });
  17. $("#allno").click(function() { voteAll("votedown"); });
  18. });
  19.  
  20. function voteAll(method) {
  21. var modal = window.ShowBlockingWaitDialog("Executing…", "Please wait until all requests finish. \nThe page will automatically reload when it is finished.");
  22. var appid = location.href.split("appid=")[1].split("&")[0];
  23. var pageinfo = $(".workshopBrowsePagingInfo").text().replace(",", "");
  24. var split = pageinfo.split(" ");
  25. var total = 0;
  26. for (var i = 0; i < split.length; i++) {
  27. if (split[i].match(/^[0-9]+$/) !== null) {
  28. total = parseInt(split[i]);
  29. }
  30. }
  31. var loaded = 1;
  32. var lastpage = Math.ceil(total/30);
  33. for (var p = 1; p <= lastpage; p++) {
  34. var url = location.href;
  35. if (url.indexOf("p=") > -1) {
  36. url = url.split("p=")[0] + "p=" + p + url.split("p=")[1].replace(url.split("p=")[1].split("&")[0], "");
  37. } else {
  38. url = url + "&p=" + p;
  39. }
  40. $.get(url, function(data) {
  41. data = data.replace(/<img\b[^>]*>/ig, "");
  42. var s = $(data).find(".workshopItemPreviewHolder");
  43. for (var i = 0; i < s.length; i++) {
  44. var wsid = s[i].getAttribute("id").replace("sharedfile_","");
  45. $.post("//steamcommunity.com/sharedfiles/" + method, { id: wsid, sessionid: window.g_sessionID }).always(function() {
  46. loaded++;
  47. modal.Dismiss();
  48. if( loaded >= total ) {
  49. location.reload();
  50. } else {
  51. modal = ShowBlockingWaitDialog( 'Executing…', 'Loaded <b>' + loaded + '</b>/' + total + '.' );
  52. }
  53. });
  54. }
  55. });
  56. }
  57. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址