|
@@ -0,0 +1,56 @@
|
|
|
+// ==UserScript==
|
|
|
+// @name AAAAA-复制标题-到memory
|
|
|
+// @namespace Violentmonkey Scripts
|
|
|
+// @icon https://memory.tianyunperfect.cn/pro_icon.svg
|
|
|
+// @match *://*/*
|
|
|
+// @exclude https://memory.tianyunperfect.cn/*
|
|
|
+// @exclude https://tracert.alipay.com/*
|
|
|
+// @exclude https://t.captcha.qq.com/*
|
|
|
+// @grant GM_registerMenuCommand
|
|
|
+// @version 1.0
|
|
|
+// @author tianyunperfect
|
|
|
+// @require https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.min.js
|
|
|
+// @require http://www.tianyunperfect.cn:3001/tianyunperfect/web-base/raw/369c684a3d4f12d24ef0e6edacde733e3a6e2d00/tmp/monkey/util.js
|
|
|
+// @description 2021/1/30 下午7:09:51
|
|
|
+// ==/UserScript==
|
|
|
+
|
|
|
+(function () {
|
|
|
+ 'use strict';
|
|
|
+ GM_registerMenuCommand("!!!复制并加到memory", to_memory)
|
|
|
+ GM_registerMenuCommand("!!!复制标题和 url", myCopy(`${pre_str}<a href="${location.href}">${document.title}</a>`))
|
|
|
+
|
|
|
+ function to_memory() {
|
|
|
+ let url = location.href;
|
|
|
+ let title = document.title;
|
|
|
+ let body = {
|
|
|
+ "back": "<p></p>",
|
|
|
+ "front": `<p>url: <a href="${url}">${title}</a></p>`,
|
|
|
+ "period": 0,
|
|
|
+ "onlyText": "",
|
|
|
+ "remindTime": new Date(),
|
|
|
+ "tag": "",
|
|
|
+ "updateTime": "",
|
|
|
+ "userId": 1
|
|
|
+ }
|
|
|
+ if (window.confirm(`${title}\n${location.host}\n`)) {
|
|
|
+ let memory_url = "https://memory.tianyunperfect.cn/api/memory-64B206F1-E915-4298-9AB7-9C561040B012/insert";
|
|
|
+ axios.post(memory_url, body).then((res) => {
|
|
|
+ console.log(res.data);
|
|
|
+ let data = res.data;
|
|
|
+ if (data.success) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ alert(data.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ document.onkeydown = function (ev) {
|
|
|
+ if (ev.key === 'c' && ev.shiftKey) {
|
|
|
+ ev.preventDefault() // 关闭浏览器快捷键
|
|
|
+ myCopy(`${pre_str}<a href="${location.href}">${document.title}</a>`)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+})();
|