Ver Fonte

Merge remote-tracking branch 'origin/master'

tianyunperfect há 3 anos atrás
pai
commit
590f0689b8
3 ficheiros alterados com 60 adições e 4 exclusões
  1. 16 0
      tmp/monkey/notion-移动到最新页面.js
  2. 27 0
      tmp/monkey/tmp.js
  3. 17 4
      tmp/monkey/web-history.js

+ 16 - 0
tmp/monkey/notion-移动到最新页面.js

@@ -0,0 +1,16 @@
+// ==UserScript==
+// @name              T-notion-迁移到最新页面
+// @author            tianyunperfect
+// @description       简介
+// @version           1.0.0
+// @update            2022年05月17日12:06:16
+// @include           https://*.notion.so/*
+// @require           https://git.tianyunperfect.cn/tianyunperfect/web-base/raw/master/tmp/monkey/util.js?a=1
+
+// ==/UserScript==
+(async () => {
+    let a = (await getDom('[style="width: calc(100% - 0px); user-select: none;"] a'));
+    if (a) {
+        location.href = a.href;
+    }
+})();

+ 27 - 0
tmp/monkey/tmp.js

@@ -0,0 +1,27 @@
+// ==UserScript==
+// @name              T-美妆-爬虫
+// @author            tianyunperfect
+// @description       简介
+// @version           1.0.0
+// @update            2021-07-08 16:16:14
+// @grant             GM_registerMenuCommand
+// @include           https://bebd.bevol.com/ranking?type=category
+// @require           https://git.tianyunperfect.cn/tianyunperfect/web-base/raw/master/tmp/monkey/util.js?a=1
+// @require     https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.min.js
+
+// ==/UserScript==
+(async () => {
+    GM_registerMenuCommand("!!!复制并加到memory", do1);
+    async function do1 () {
+        let res =[]
+        let rows = (await getDomAll(".ant-table-tbody [data-row-key]"))
+        for (let x in rows) {
+            if (x < 50) {
+                res.push(rows[x].getAttribute("data-row-key"));
+            }
+        }
+        console.log(res)
+    };
+
+
+})();

+ 17 - 4
tmp/monkey/web-history.js

@@ -18,17 +18,30 @@
                 "user_id": 1
             }).then(res => {
                 console.log(res.data);
+            }).catch(function (error) {
+                alert(error);
             });
         }
     }
 
+    function getKey() {
+        return "t_href" + location.href;
+    }
+
+    function setTitle() {
+        localStorage.setItem(getKey(), document.title);
+    }
+
+    function checkTitle() {
+        return localStorage.getItem(getKey()) !== document.title
+    }
+
     setTimeout(() => {
-        let t_href = "t_href"
-        localStorage.setItem(t_href, document.title);
+        setTitle();
         save();
         setInterval(() => {
-            if (localStorage.getItem(t_href) !== document.title) {
-                localStorage.setItem(t_href, document.title);
+            if (checkTitle()) {
+                setTitle();
                 save();
             }
         }, 5000)