// ==UserScript== // @name Poe Content Summarizer // @namespace http://tampermonkey.net/ // @version 1.6 // @description Summarize clipboard content on Poe and auto-submit with smooth delay // @match https://poe.com/* // @icon https://plus.unsplash.com/premium_photo-1673795754005-214e3e1fccba?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxmZWF0dXJlZC1waG90b3MtZmVlZHwzN3x8fGVufDB8fHx8fA%3D%3D // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; let lastKeyTime = 0; let consecutiveOne = 0; document.addEventListener('keydown', function(e) { if (e.key === '1') { let currentTime = new Date().getTime(); if (currentTime - lastKeyTime < 500) { consecutiveOne++; if (consecutiveOne === 2) { e.preventDefault(); summarizeClipboard(); } } else { consecutiveOne = 1; } lastKeyTime = currentTime; } else { consecutiveOne = 0; } }); function summarizeClipboard() { navigator.clipboard.readText().then(clipText => { let textArea = document.querySelector('textarea'); if (textArea) { // 移除剪贴板内容开头和结尾的空白字符 clipText = clipText.trim(); textArea.value = `##${clipText}##\n\n你是一名内容总结专家,分析以上内容: 1. 详细总结该内容 2. 提炼3-5个核心观点 3. 基于内容提出2个深度问题并回答 4. 不要有幻觉,尊重内容原文 尽可能详细地回答,确保覆盖所有要点`; textArea.dispatchEvent(new Event('input', { bubbles: true })); // 添加延迟以使过程更加顺滑 setTimeout(() => { // 模拟按下回车键 const enterEvent = new KeyboardEvent('keydown', { bubbles: true, cancelable: true, keyCode: 13, which: 13, key: 'Enter' }); textArea.dispatchEvent(enterEvent); }, 300); // 300毫秒的延迟,可以根据需要调整 } }); } })();