LINUXDO_帖子随机数据库
7 subscribers
3.04K links
自动阅读脚本抓取的帖子会发送到这里
Download Telegram
ry light grey) */ /* Shadow Colors */ --chat-customize-box-shadow: 0 0 0 1px rgba(48, 54, 61, 0.185); /* Standard box shadow */ --chat-customize-box-shadow2: none; --chat-customize-box-shadow3: inset 0 0 0 1px rgba(48, 54, 61, 0.226); /* Inset shadow */ --chat-customize-box-shadow4: inset 0 0 0 1px rgba(139, 148, 158, 0.8); /* Brighter inset shadow */ /* Other Variables */ --list-item-border-radius: 6px; /* Border radius for list items/containers */ --color-black-rgb: 16, 27, 34; /* RGB for #161b22 */ --color-white-rgb: 249, 233, 233; /* RGB for #f9e9e9 */ /* Background Image */ background-image: url('https://kupitkan.com/upload/iblock/ca9/sw0qn2658mdbbkfowrn1pevewx6wubie.jpg'); background-size: cover; background-position: center center; background-repeat: no-repeat; background-attachment: fixed; } /* --- Light Mode (MODIFIED TO BLUE THEME) --- */ body[theme-mode="light"] { /* Accent Colors (Blue Scheme) */ --color-cyber-accent: #1E90FF; /* Dodger Blue - Primary Accent */ --color-cyber-accent-bright: #00BFFF; /* Deep Sky Blue - Bright Accent */ --color-cyber-accent-purple: #4169E1; /* Royal Blue - Contrast Accent (used for blockquotes etc.) */ --color-cyber-accent-rgb: 30, 144, 255; /* RGB for --color-cyber-accent */ --color-cyber-accent-purple-rgb: 65, 105, 225; /* RGB for --color-cyber-accent-purple (Royal Blue) */ /* Line & Corner Effects (Derived from Accent RGB) */ --color-cyber-line: rgba(var(--color-cyber-accent-rgb), 0.7); --color-cyber-line-dim: rgba(var(--color-cyber-accent-rgb), 0.3); /* Glow Effects (Derived from Accent RGB) */ /* Note: Variable names kept for potential cross-theme compatibility, but values use blue */ --shadow-cyber-glow-teal: rgba(var(--color-cyber-accent-rgb), 0.15); /* Glow uses primary blue */ --shadow-cyber-glow-purple: rgba(var(--color-cyber-accent-purple-rgb), 0.1); /* Contrast glow uses Royal Blue */ /* Background Colors (Semi-transparent for blur effect) */ --color-background: transparent; /* Main body background is image */ --color-background-soft: rgba(246, 248, 250, 0.8); /* Soft background for UI elements */ --color-background-mute: rgba(240, 242, 245, 0.8); /* Mute background for hover/focus */ --navbar-background: transparent; --chat-background: transparent; --chat-background-user: rgba(246, 248, 250, 0.65); /* User bubble background */ --chat-background-assistant: rgba(246, 248, 250, 0.65); /* Assistant bubble background */ --chat-customize-collapse-background: rgba(246, 248, 250, 0.7); /* Collapse panel content background */ --color-background-opacity: rgba(246, 248, 250, 0.6); /* More opaque background for some containers */ --color-background-rgb: 246, 248, 250; /* RGB for main background color */ --antd-arrow-background-color: rgba(240, 242, 245, 0.7); /* Antd tooltip/popover arrow background */ /* Text Colors */ --chat-text-user: #2d3846; /* User chat text color */ --color-text-1: #2d3846; /* Primary text color */ --color-text-2: #57606a; /* Secondary text color */ --chat-customize-codeHeader: #57606a; /* Code block header color */ --color-white: #ffffff; /* Light theme "white" (true white) */ --color-black: #2d3846; /* Light theme "black" (dark grey) */ /* Shadow Colors */ --chat-customize-box-shadow: 0 1px 3px rgba(27, 31, 35, 0.031); /* Standard box shadow */ --chat-customize-box-shadow2: none; --chat-customize-box-shadow3: inset 0 1px 1px rgba(27, 31, 35, 0.048), 0 0 0 1px rgba(208, 215, 222, 0.8); /* Inset shadow */ --chat-customize-box-shadow4: inset 0 1px 1px rgba(27, 31, 35, 0.1), 0 0 0 1px rgba(208, 215, 222, 0.8); /* Brighter inset shadow */ /* Other Variables */ --list-item-border-radius: 6px; /* Border radius for list items/containers */ --color-black-rgb: 45, 56, 70; /* RGB for #2d3846 */ --color-white-rgb: 255, 255, 255; /* RGB for #ffffff */ /* Background Image (Kept original light mode image) */ background-image: url('https://images.unsplash.com/photo-1668853853439-923e013afff1?q=80&w=2670&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA
标题: 【LinuxDo分屏浏览脚本】必备刷帖神器~
作者: aBER
内容: 太酷了! 立马用上!
时间: Sat, 28 Jun 2025 13:35:52 +0000
作者: zzzqq
回复: cotagxrdhy: // ==UserScript== // @name Linux.do 左右分栏浏览 // @namespace http://tampermonkey.net/ // @version 1.0 // @description No // @author You // @match https://linux.do/* // @match https://www.linux.do/* // @grant GM_addStyle // @grant GM_xmlhttpRequest // @connect linux.do // @run-at document-start // ==/UserScript== (function() { 'use strict'; // =========================================== // 自定义参数设置 (User Customization Parameters) // =========================================== const LEFT_PANEL_WIDTH = '1251px'; const RIGHT_PANEL_MAX_WIDTH = '900px'; const GAP_WIDTH = '24px'; const HEADER_HEIGHT = '60px'; const HOT_TOPICS_COUNT = 10; const CACHE_MINUTES = 5; // =========================================== // 辅助函数与配置 (Helpers & Config) // =========================================== const ICONS = { /* ... */ }; let formatTimeAgo = function(dateString) { /* ... */ }; Object.assign(ICONS, { replies: `<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg>`, views: `<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>`, likes: `<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg>` }); formatTimeAgo = function(dateString) { const now = new Date(); const past = new Date(dateString); const diffInSeconds = Math.floor((now - past) / 1000); if (diffInSeconds < 60) return `${diffInSeconds}秒前`; const diffInMinutes = Math.floor(diffInSeconds / 60); if (diffInMinutes < 60) return `${diffInMinutes}分钟前`; const diffInHours = Math.floor(diffInMinutes / 60); if (diffInHours < 24) return `${diffInHours}小时前`; const diffInDays = Math.floor(diffInHours / 24); if (diffInDays < 30) return `${diffInDays}天前`; return past.toLocaleDateString(); }; // =========================================== // 脚本逻辑 (Script Logic) // =========================================== const useFixedWidth = LEFT_PANEL_WIDTH.trim() !== ''; document.documentElement.style.setProperty('--gap-width', GAP_WIDTH); document.documentElement.style.setProperty('--header-height', HEADER_HEIGHT); const leftPanelCalcWidth = useFixedWidth ? LEFT_PANEL_WIDTH : 'min(100% - 40px, 1100px)'; document.documentElement.style.setProperty('--left-panel-width', `calc(${leftPanelCalcWidth})`); GM_addStyle(` /* --- 基础布局 --- */ html, body { overflow: hidden !important; } #main-outlet { height: calc(100vh - var(--header-height, 60px)); overflow-y: auto; padding-right: 8px; } ${useFixedWidth ? `#main-outlet, .wrap, .d-header .wrap { max-width: ${LEFT_PANEL_WIDTH} !important; }` : ''} #main-outlet, .wrap, .d-header .wrap { margin-left: 0 !important; margin-right: auto !important; padding-left: 20px !important; } /* --- 右侧容器 --- */ #topic-iframe-container { position: fixed; top: 0; right: 0; width: calc(100vw - (var(--left-panel-width) + var(--gap-width))); max-width: ${RIGHT_PANEL_MAX_WIDTH}; height: 100vh; background: #f4f6f8; box-shadow: -3px 0 15px rgba(0,0,0,0.1); overflow: hidden; z-index: 1000; } #topic-iframe-container.iframe-mode { background: #ffffff; } /* --- Iframe & 占位视图切换 --- */ #topic-iframe, .iframe-loading { display: none; } #topic-iframe-container.iframe-mode #topic-if
rame, #topic-iframe-container.iframe-mode .iframe-loading { display: block; } #topic-iframe-container.iframe-mode #placeholder-content { display: none; } #topic-iframe { width: 100%; height: 100%; border: none; } .iframe-loading { color: #666; font-size: 18px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } #placeholder-content { width: 100%; padding: 25px; box-sizing: border-box; } .placeholder-title { font-size: 20px; font-weight: 600; color: #333; margin-bottom: 20px; text-align: center; } .topic-card-list { list-style: none; padding: 0; margin: 0; } .topic-card { display: flex; align-items: center; background: #ffffff; border-radius: 10px; margin-bottom: 12px; padding: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border: 1px solid #e9ecef; opacity: 0; transform: translateY(15px); animation: fadeIn 0.4s ease forwards; transition: all 0.2s ease-in-out; } .topic-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-color: #007bff; } @keyframes fadeIn { to { opacity: 1; transform: translateY(0); } } .card-avatar { width: 40px; height: 40px; border-radius: 50%; margin-right: 12px; flex-shrink: 0; } .card-main { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; min-width: 0; } .card-title-link { text-decoration: none; color: #212529; margin-bottom: 8px; } .card-title-text { font-size: 16px; font-weight: 600; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .card-meta { display: flex; justify-content: space-between; align-items: center; color: #6c757d; font-size: 12px; } .card-meta-left { display: flex; align-items: center; gap: 12px; white-space: nowrap; } .author-name { font-weight: 500; color: #495057; } .stat-item { display: flex; align-items: center; gap: 4px; } .card-time { flex-shrink: 0; padding-left: 10px; } .placeholder-status { font-size: 16px; color: #888; text-align:center; padding-top: 40vh; } /* --- 其他UI元素 --- */ .topic-list-item.current-preview, tr.current-preview { background-color: #eef5ff !important; } .topic-list-item.current-preview { border-left: 4px solid #3498db; } #hide-button-wrapper { position: absolute; top: 0; left: 0; bottom: 0; width: 40px; z-index: 1001; display: none; } #topic-iframe-container.iframe-mode #hide-button-wrapper { display: block; } #hide-iframe-button { position: absolute; top: 50%; left: 0; transform: translateY(-50%); width: 28px; height: 70px; background-color: #007bff; color: white; border: none; border-radius: 0 15px 15px 0; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: bold; line-height: 70px; box-shadow: 2px 2px 8px rgba(0,0,0,0.1); opacity: 0; pointer-events: none; transition: opacity 0.2s ease-in-out, background-color 0.2s; } #hide-button-wrapper:hover #hide-iframe-button { opacity: 0.85; pointer-events: auto; } #hide-iframe-button:hover { background-color: #0056b3; opacity: 1; } `); // --- JS函数部分 --- function renderTopicCards(data) { const placeholder = document.getElementById('placeholder-content'); if (!data || !data.topic_list || !data.topic_list.topics) { placeholder.innerHTML = `<div class="placeholder-status">未能获取到帖子</div>`; return; } const topics = data.topic_list.topics.slice(0, HOT_TOPICS_COUNT); const users = new Map(data.users.map(user => [user.id, user])); const cardsHtml = topics.map((topic, index) => { const originalPoster = topic.posters.find(p => p.description.includes('Original Poster')) || topic.posters[0]; const user = users.get(originalPoster.user_id); const avatarUrl = user ? `https://${window.location.hostname}${user.avatar_template.replace('{size}', '80')}` : ''; return ` <li class="topic-card" style="animation-delay: ${index * 0.06}s;"> ${user ? `<img src="${avatarUrl}" class="card-avatar" alt="${user.username}">` : '<div class="card-avatar"></div>'} <div class="card-main"> <a href="/t/${topic.slug}/${topic.id
dth=device-width, initial-scale=1.0"> <title>Highlight AI API</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; background: #f5f5f7; color: #1d1d1f; line-height: 1.6; font-size: 16px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; } .container { max-width: 720px; margin: 0 auto; padding: 20px 16px; } .header { text-align: center; margin-bottom: 40px; padding-bottom: 20px; border-bottom: 1px solid #e5e5e7; } .header h1 { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; color: #1d1d1f; margin-bottom: 12px; } .header p { font-size: 18px; color: #6e6e73; font-weight: 400; } .section { background: #ffffff; border-radius: 12px; padding: 20px; margin-bottom: 16px; border: 1px solid #e5e5e7; } .section-title { font-size: 20px; font-weight: 600; color: #1d1d1f; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; } .step-number { width: 28px; height: 28px; background: #1d1d1f; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; } .section-content { color: #6e6e73; font-size: 15px; line-height: 1.4; margin-bottom: 16px; } .url-box { background: #f5f5f7; border: 1px solid #d2d2d7; border-radius: 8px; padding: 12px; margin: 12px 0; font-family: 'SF Mono', Monaco, monospace; font-size: 13px; color: #1d1d1f; word-break: break-all; line-height: 1.3; } .form-group { margin: 16px 0; } .form-label { display: block; font-size: 15px; font-weight: 500; color: #1d1d1f; margin-bottom: 6px; } .form-input { width: 100%; padding: 12px 16px; border: 1px solid #d2d2d7; border-radius: 8px; font-size: 15px; background: #ffffff; color: #1d1d1f; transition: border-color 0.15s ease; } .form-input:focus { outline: none; border-color: #007aff; } .form-input::placeholder { color: #a1a1a6; } .btn { display: inline-block; width: 100%; padding: 12px 20px; background: #1d1d1f; color: #ffffff; text-decoration: none; font-size: 15px; font-weight: 500; border: none; border-radius: 8px; cursor: pointer; transition: background-color 0.15s ease; text-align: center; } .btn:hover { background: #424245; } .btn:disabled { background: #d2d2d7; color: #a1a1a6; cursor: not-allowed; } .btn-secondary { background: #f5f5f7; color: #1d1d1f; border: 1px solid #d2d2d7; } .btn-secondary:hover { background: #e5e5e7; } .btn-small { padding: 8px 16px; font-size: 14px; width: auto; display: inline-block; } .btn-test { background: #007aff; margin-left: 8px; } .btn-test:hover { background: #0056cc; } .loading { display: none; text-align: center; padding: 16px; color: #6e6e73; font-size: 15px; } .loading-spinner { width: 16px; height: 16px; border: 2px solid #d2d2d7; border-top: 2px solid #1d1d1f; border-radius: 50%; display: inline-block; animation: spin 1s linear infinite; margin-right: 8px; vertical-align: middle; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .result { margin-top: 16px; padding: 16px; border-radius: 8px; display: none; } .result.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; } .result.error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; } .result h4 { font-size: 16px; font-weight: 600; margin-bottom: 8px; } .api-key-section { margin-top: 16px; padding: 16px; background: #f8f9fa; border-radius: 8px; border: 1px solid #e5e5e7; } .api-key-label { font-weight: 600; margin-bottom: 8px; color: #1d1d1f; font-size: 14px; } .api-key-box { background: #ffffff; border: 1px solid #d2d2d7; border-radius: 6px; padding: 12px; font-family: 'SF Mono', Monaco, monospace; font-size: 12px; word-break: break-all; color: #1d1d1f; margin-bottom: 8px; } .copy-btn { background: #007aff; color: white; border: none; padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; } .copy-btn:hover { background: #005
6cc; } .success-message { margin-top: 16px; padding: 16px; background: #f0fdf4; border-radius: 8px; border: 1px solid #bbf7d0; } .success-title { font-weight: 600; color: #166534; margin-bottom: 6px; font-size: 14px; } .success-content { color: #166534; line-height: 1.4; font-size: 14px; } .success-content code { background: #ffffff; padding: 2px 6px; border-radius: 4px; font-family: 'SF Mono', Monaco, monospace; font-size: 12px; border: 1px solid #bbf7d0; } .info-section { background: #f8f9fa; border-radius: 8px; padding: 16px; margin-top: 16px; border: 1px solid #e5e5e7; } .info-title { font-size: 16px; font-weight: 600; color: #1d1d1f; margin-bottom: 12px; } .models-grid { display: grid; gap: 8px; margin-top: 12px; } .model-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; background: #ffffff; border: 1px solid #e5e5e7; border-radius: 6px; } .model-name { font-weight: 500; color: #1d1d1f; font-size: 14px; } .model-provider { font-size: 12px; color: #6e6e73; } .input-row { display: flex; gap: 8px; align-items: stretch; } .input-row .form-input { flex: 1; } .input-row .btn { height: auto; min-height: 44px; display: flex; align-items: center; justify-content: center; } @media (max-width: 768px) { .container { padding: 16px 12px; } .header h1 { font-size: 28px; } .header p { font-size: 16px; } .section { padding: 16px; } .input-row { flex-direction: column; gap: 8px; } .btn-small { width: 100%; } } </style> </head> <body> <div class="container"> <div class="header"> <h1>Highlight 2 API</h1> </div> <div class="info-section"> <div class="info-title">支持的模型</div> <div id="modelsList"> <div style="text-align: center; color: #6e6e73; padding: 20px;"> 请先获取 API Key 以查看可用模型 </div> </div> </div> <div class="section"> <div class="section-title"> <span class="step-number">1</span> API Key 有效性检测 </div> <div class="section-content"> 您可以使用现有的 API Key,或者通过登录生成新的 API Key: </div> <div class="form-group"> <label class="form-label" for="apiKeyInput">API Key</label> <div class="input-row"> <input type="text" id="apiKeyInput" class="form-input" placeholder="粘贴您的 API Key 或点击下方生成新的" /> <button class="btn btn-small btn-test" onclick="testApiKey()"> 测试并获取可用模型 </button> </div> </div> <div class="result" id="testResult"> <div id="testResultContent"></div> </div> </div> <div class="section"> <div class="section-title"> <span class="step-number">2</span> 生成新的 API Key </div> <div class="section-content"> 如果您没有 API Key,请通过登录生成: </div> <div class="url-box"> https://chat-backend.highlightai.com/api/v1/auth/signin?screenHint=sign-in </div> <button class="btn btn-secondary" onclick="openLoginPage()"> 打开登录页面 </button> <div style="background: #fff3cd; border: 1px solid #ffeaa7; border-radius: 8px; padding: 12px; margin: 12px 0; color: #856404; font-size: 14px;"> <strong>重要提示:</strong><br> 1. 点击上方按钮打开登录页面<br> 2. 完成登录后,浏览器会跳转到新页面<br> 3. 在浏览器地址栏中找到类似这样的链接:<br> <code style="background: #fff; padding: 2px 4px; border-radius: 3px;">https://highlightai.com/deeplink?code=01CKIO2YTC359TRVJ1QVNQP21A</code><br> 4. 复制 <strong>code=</strong> 后面的值(如:01CKIO2YTC359TRVJ1QVNQP21A)<br> 5. 粘贴到下方输入框中 </div> <div class="form-group"> <label class="form-label" for="codeInput">授权代码(浏览器地址栏中 code= 后面的值)</label> <input type="text" id="codeInput" class="form-input" placeholder="例如:01CKIO2YTC359TRVJ1QVNQP21A" /> </div> <button class="btn" onclick="login()" id="loginBtn"> 生成 API Key </button> <div class="loading" id="loading"> <span class="loading-spinner"></span> 正在处理... </div> </div> <div class="result" id="result"&