淘宝众筹项目【OneCloud玩客云】抢购

实时监控第一个可支持的¥279项目并立即进入下订单页(抢购成功后进入支付页需要手动支付)

  1. // ==UserScript==
  2. // @name 淘宝众筹项目【OneCloud玩客云】抢购
  3. // @namespace http://oixm.cn/
  4. // @version 1.0
  5. // @description 实时监控第一个可支持的¥279项目并立即进入下订单页(抢购成功后进入支付页需要手动支付)
  6. // @author oixm
  7. // @match https://izhongchou.taobao.com/dreamdetail.htm?*id=20067780*
  8. // @require http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.4.min.js
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // 抢购器
  16. function OneCloud() {
  17. this.id = "20067780"; // 众筹产品 id
  18. this.price = 279; // 抢购价格
  19. this.startTime = new Date(2017, (9 - 1), 10, 10, 30, 0).getTime(); // 开启时间
  20. this.interval = 0; // 刷新间隔时间
  21. this.count = 0; // 抢购尝试次数
  22. }
  23.  
  24. // 开始
  25. OneCloud.prototype.start = function() {
  26. this.getProductDetail(function(item) {
  27. this.buy(item);
  28. });
  29. };
  30.  
  31. // 获取产品详情
  32. OneCloud.prototype.getProductDetail = function(callback) {
  33. var _this = this;
  34. $.ajax({
  35. url: "https://izhongchou.taobao.com/dream/ajax/getProjectForDetail.htm",
  36. dataType: "jsonp",
  37. data: {
  38. "id": this.id,
  39. "ac": ""
  40. },
  41. success: function(data) {
  42. var items = data.data.items;
  43. for (var i = 0; i < items.length; i++) {
  44. var item = items[i];
  45. // 活动开启
  46. if (parseFloat(item.price) == _this.price && item.can_buy) {
  47. return callback.call(_this, item);
  48. }
  49. }
  50. // 刷新
  51. _this.refresh();
  52. setTimeout(function() {
  53. _this.getProductDetail(callback);
  54. }, _this.interval);
  55. }
  56. });
  57. };
  58.  
  59. // 刷新
  60. OneCloud.prototype.refresh = function() {
  61. var now = new Date().getTime();
  62. var timespan = Math.abs(this.startTime - now);
  63. this.interval = timespan < 60000 ? 200 : (timespan < 600000 ? 1000 : 10000); // 60 秒内快速刷新
  64. if (now >= this.startTime) {
  65. document.title = "抢购中(尝试" + (++this.count) + "次)";
  66. } else {
  67. document.title = "倒计时 " + this.formatTime(timespan);
  68. }
  69. };
  70.  
  71. // 格式化时间
  72. OneCloud.prototype.formatTime = function(t) {
  73. var x = "";
  74. var h = 0, m = 0, s = 0;
  75. if (t < 60000) {
  76. s = parseInt(t / 1000);
  77. t -= (1000 * s);
  78. x = "00:" + (s < 10 ? "0" + s : s) + "." + t;
  79. } else {
  80. if (t >= 3600000) {
  81. h = parseInt(t / 3600000);
  82. t -= (3600000 * h);
  83. x += (h + "时");
  84. }
  85. m = parseInt(t / 60000);
  86. t -= (60000 * m);
  87. x += ((m < 10 ? "0" + m : m) + "分");
  88. s = parseInt(t / 1000);
  89. x += ((s < 10 ? "0" + s : s) + "秒");
  90. }
  91. return x;
  92. };
  93.  
  94. // 购买
  95. OneCloud.prototype.buy = function(item) {
  96. document.title = "【抢购成功】";
  97. window.location = item.buy_url;
  98. };
  99.  
  100. // Ready
  101. $(function() {
  102. new OneCloud().start();
  103. });
  104.  
  105. })();

QingJ © 2025

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