您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
6/16/2023, 4:53:06 PM
// ==UserScript== // @name Add Trakt Button to Letterboxd Film Pages // @namespace https://greasyfork.org/en/users/96096-purplepinapples // @match https://letterboxd.com/film/* // @grant none // @version 0.1 // @author - // @license MIT // @description 6/16/2023, 4:53:06 PM // ==/UserScript== (function() { // add a button to the page after the tmdb button which links // to the corresponding search page on trakt // get the tmdb button const tmdbButton = document.querySelector('a.micro-button[href*="themoviedb"]') if (!tmdbButton) return // get ID const tmdb_movie_id = tmdbButton.href.match(/\/(\d+)\//)[1] console.log(tmdb_movie_id) // create the trakt button const traktButton = document.createElement('a') traktButton.classList.add('micro-button') traktButton.href = `https://trakt.tv/search/tmdb/${tmdb_movie_id}?id_type=movie` traktButton.innerText = 'Trakt' traktButton.style.marginLeft = '2px' // add the trakt button after the tmdb button tmdbButton.parentNode.insertBefore(traktButton, tmdbButton.nextSibling) })()