查看: 169|回复: 0

[.NET源码] 双11抢券,写一个自动打开页面的html,仅仅是设定时间打开抢券的页面

发表于 5 天前
太阳http代理AD
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title></title>
  6. <style type="text/css">
  7. #result{
  8. width:500px;
  9. border:1px solid #CCCCCC;
  10. background:#FFFFCC;
  11. margin:50px auto;
  12. font-size:24px;
  13. color:#FF0000;
  14. padding:20px;
  15. }
  16. </style>
  17. <script type="text/javascript">
  18. window.onload = function () {
  19. showTime();
  20. var start = document.getElementById("start");
  21. start.onclick=function () {
  22. var path = document.getElementById("path").value;
  23. var time1 = document.getElementById("time1").value;
  24. var time2 = document.getElementById("time2").value;
  25. var time3 = document.getElementById("time3").value;
  26. start.value = "等待打开抢单页面";
  27. setInterval(function () {
  28. var date = new Date();
  29. var hour = date.getHours();
  30. var minute = date.getMinutes();
  31. var second = date.getSeconds();
  32. if (hour == time1 && minute == time2 && second == time3) {
  33. window.open(path);
  34. }
  35. }, 100);
  36. };
  37. }
  38. function showTime()
  39. {
  40. //创建Date对象
  41. var today = new Date();
  42. //分别取出年、月、日、时、分、秒
  43. var year = today.getFullYear();
  44. var month = today.getMonth()+1;
  45. var day = today.getDate();
  46. var hours = today.getHours();
  47. var minutes = today.getMinutes();
  48. var seconds = today.getSeconds();
  49. //如果是单个数,则前面补0
  50. month = month<10 ? "0"+month : month;
  51. day = day <10 ? "0"+day : day;
  52. hours = hours<10 ? "0"+hours : hours;
  53. minutes = minutes<10 ? "0"+minutes : minutes;
  54. seconds = seconds<10 ? "0"+seconds : seconds;
  55. //构建要输出的字符串
  56. var str = year+"年"+month+"月"+day+"日 "+hours+":"+minutes+":"+seconds;
  57. //获取id=result的对象
  58. var obj = document.getElementById("result");
  59. //将str的内容写入到id=result的<div>中去
  60. obj.innerHTML = str;
  61. //延时器
  62. window.setTimeout("showTime()",1000);
  63. }
  64. </script>
  65. </head>
  66. <body>
  67. <div>
  68. <h2>1,同步电脑时间和北京时间</h2>
  69. <h2>2,设置path地址为需要抢券的地址和抢券时间</h2>
  70. <!--<h3>抢券地址</h3><input type="text" id=path />-->
  71. <h3>抢券地址(注意不要漏掉http://或者https://)</h3> <!--<textarea id="path" style="width:200px;height:80px;"></textarea>-->
  72. <input type="url" id="path" style="width:auto"/>
  73. <h3>抢券时间</h3>
  74. <input type="text" id=time1 />时<input type="text" id=time2 />分
  75. <input type="text" id=time3 />秒
  76. <h2>3,点击等待,然后去点击抢券</h2>
  77. <input type="button" id="start" value="开始"/><div id="result"></div>
  78. </div>
  79. </body>
  80. </html>
复制代码



太阳http代理AD
回复

使用道具 举报