Groupees - Exporter

Export steam keys and mark them as used

目前為 2017-02-10 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Groupees - Exporter
  3. // @icon https://groupees.com/favicon.ico
  4. // @namespace Royalgamer06
  5. // @author Royalgamer06
  6. // @version 1.0.0
  7. // @description Export steam keys and mark them as used
  8. // @include https://groupees.com/purchases
  9. // @grant unsafeWindow
  10. // @run-at document-idle
  11. // @require https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js
  12. // ==/UserScript==
  13.  
  14. this.$ = this.jQuery = jQuery.noConflict(true);
  15. $(".pre-nav").append('<button style="float:right;" onclick="exportUnused()">Export unused</button>');
  16. unsafeWindow.exportUnused = function() {
  17. var win = window.open("", "", "width=480,height=640");
  18. $(".code:not([disabled])").each(function() {
  19. $(this).parents(".product").find(".usage").click();
  20. win.document.write($(this).parents(".product").find("h3").text() + "<br>" + $(this).val() + "<br><br>");
  21. });
  22. var range = win.document.createRange();
  23. range.selectNodeContents(win.document.body);
  24. var selection = win.window.getSelection();
  25. selection.removeAllRanges();
  26. selection.addRange(range);
  27. };