批量删除京东优惠券

批量删除京东优惠券(全部删除)

  1. // ==UserScript==
  2. // @name 批量删除京东优惠券
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description 批量删除京东优惠券(全部删除)
  6. // @author wuzhizhemu569@gmail.com
  7. // @match https://quan.jd.com/user_quan.action*
  8. // @grant none
  9. // @run-at document-end
  10. // @require http://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js
  11. // ==/UserScript==
  12.  
  13. var url = 'https://quan.jd.com/user_quan.action?couponType=-1&sort=3&page=1';
  14.  
  15. (function() {
  16. 'use strict';
  17. setTimeout(function() {
  18.  
  19. var length = $('.coupon-item .c-range').length;
  20. if (length === 0) return;
  21. location.href = url;
  22. for (var i = 0 ; i < length ;i++) {
  23. var para = {
  24. couponId: $('.coupon-item .c-range:eq('+i+') .range-item:eq(2) span.txt').text(),
  25. pin: document.cookie.replace(/(?:(?:^|.*;\s*)pin\s*\=\s*([^;]*).*$)|^.*$/, "$1")
  26. }
  27. jQuery.ajax({
  28. type: "POST",
  29. url: "/lock_coupon.action?r=" + Math.random(),
  30. data: para,
  31. dataType: "json",
  32. cache: false,
  33. success: function (result) {}
  34. });
  35. }
  36. setTimeout(function() {
  37. location.href = url
  38. }, 1000)
  39. }, 2000)
  40.  
  41. })();

QingJ © 2025

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