查询贴吧周报

查看某个吧的贴吧周报(以7天为周期),全局上似乎已经不会更新数据了?但每个吧最后更新进度可能不一致。也许api参数变了我还不知道?

  1. // ==UserScript==
  2. // @name 查询贴吧周报
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1.3
  5. // @description 查看某个吧的贴吧周报(以7天为周期),全局上似乎已经不会更新数据了?但每个吧最后更新进度可能不一致。也许api参数变了我还不知道?
  6. // @author shitianshiwa
  7. // @include http*://tieba.baidu.com/*
  8. // @require https://cdn.jsdelivr.net/npm/jquery@3.4.0/dist/jquery.min.js
  9. // @run-at document-idle
  10. // @grant GM_registerMenuCommand
  11. // @grant unsafeWindow
  12. // @license MIT
  13. // ==/UserScript==
  14. //https://www.52fisher.cn/93.html 常用贴吧接口 April 15, 2016 http://tieba.baidu.com/sign/info?kw=&ie=utf-8
  15. //https://tieba.baidu.com/mo/q/weeklybazhuview?fid=&beginTime=1590768000 贴吧周报api
  16. //https://tieba.baidu.com/mo/q/weeklybazhuview?fid=6087183&beginTime=1590768000
  17. (function($) {
  18. 'use strict';
  19.  
  20. function AA() //贴吧周报
  21. {
  22. let a = prompt("请输入贴吧名:", unsafeWindow.PageData.forum.forum_name || unsafeWindow.PageData.forum.name || "");
  23. let t0 = parseInt(new Date().getTime() / 1000); //获取当前的时间戳
  24. let step = parseInt((t0 - 1590768000) / 604800); //获取周数
  25. let t1 = new Array(); //从2020-05-30 00:00:00开始,到最新的时间戳除以7天604800
  26. let t;
  27. for (let i = 0; i < step; i++) {
  28. t = new Date((1590768000 + 604800 * i) * 1000); //毫秒
  29. t1.push("日期:" + t.getFullYear() + "年" + (t.getMonth() + 1) + "月" + t.getDate() + "日" + (t.getUTCHours() + 8).toString().replace("24", "0") + "时" + t.getMinutes() + "分" + t.getSeconds() + "秒,时间戳:" + t.getTime() / 1000 + "\n");
  30. }
  31. let z = document.createElement("div"); //创建节点<input/>
  32. /* z.setAttribute('id', 'div1');
  33. z.setAttribute('class', 'divstyle');
  34. z.setAttribute('style', "background:#66ccff;width:500px;heigth:500px;");*/
  35. console.log(t1);
  36. let t2 = prompt(t1 + "请输入一个时间戳:", t1[t1.length - 1].split("时间戳:")[1].replace("\n", ""));
  37. //document.body.append(z);
  38. a = a.trim(); //去掉首尾空格
  39. if (a != null && a != "") {
  40. let b = "/sign/info";
  41. let c = { 'kw': a, 'ie': 'utf-8' };
  42. $.post(b, c, function(o) {
  43. if (o.no == 0) {
  44. let temp = o.data.forum_info.forum_info.forum_id;
  45. let t = new Date(t2 * 1000 /*(1590768000+604800)*1000*/ ); //毫秒
  46. alert(t.getFullYear() + "年" + (t.getMonth() + 1) + "月" + t.getDate() + "日" + (t.getUTCHours() + 8) + "时" + t.getMinutes() + "分" + t.getSeconds() + "秒")
  47. window.open("https://tieba.baidu.com/mo/q/weeklybazhuview?fid=" + temp + "&beginTime=" + t.getTime() / 1000); //2020-05-30 01:00:00,604800 7天
  48. } else {
  49. alert("no:" + o.no + "error:" + o.error);
  50. }
  51. }, "json");
  52. } else {
  53. alert("贴吧名为空" + a);
  54. }
  55. }
  56. GM_registerMenuCommand("查询吧周报", AA); // @grant GM_registerMenuCommand
  57. })($);

QingJ © 2025

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