您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds links allowing search on Twitter (by title and url) to video detail screen.
// ==UserScript== // @name BitChute: search video on twitter // @version 2 // @grant none // @require https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js // @match https://www.bitchute.com/* // @author monnef // @description Adds links allowing search on Twitter (by title and url) to video detail screen. // @namespace monnef.eu // ==/UserScript== const cls = 'tw-link'; const genTwitterSearchURL = str => `https://twitter.com/search?q=${encodeURIComponent(str)}&src=typed_query`; const pipe = (...args) => { const [input, ...fs] = args; return fs.reduce((acc, x) => x(acc), input); } const chopVideoLink = x => x.replace(/\/\?.*/, ''); const work = () => { const titleEl = $('#video-title'); if (titleEl.hasClass(cls)) { return; } titleEl.addClass(cls); const pubDateEl = $('.video-publish-date'); const linkAddressByTitle = genTwitterSearchURL(titleEl.text()); const linkAddressByURL = genTwitterSearchURL(pipe(document.location.href, chopVideoLink)); const titleSearchEl = $('<a/>').text('title').attr('target', '_blank').attr('href', linkAddressByTitle); const urlSearchEl = $('<a/>').text('URL').attr('target', '_blank').attr('href', linkAddressByURL); const el = $('<div>').text('Search on Twitter: ').append(titleSearchEl).append(' / ').append(urlSearchEl); pubDateEl.after(el); }; $(() => setInterval(work, 1000));