您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Leverage Letterboxd API to include Letterboxd and IMDB links for movies on the ByTowne website
// ==UserScript== // @name ByTowne Letterboxd Link // @namespace vignesh.one // @version 0.1 // @description Leverage Letterboxd API to include Letterboxd and IMDB links for movies on the ByTowne website // @author Vignesh K // @match https://www.bytowne.ca/movies/* // @icon https://www.letterboxd.com // @grant GM_xmlhttpRequest // @run-at document-end // @license GNU GPLv3 // ==/UserScript== (function() { 'use strict'; const LETTERBOXD_ICON = "https://a.ltrbxd.com/logos/letterboxd-decal-dots-pos-rgb-500px.png"; const movieName = document.querySelector('h1.elementor-heading-title').textContent; GM_xmlhttpRequest({ method: 'GET', url: 'https://api.letterboxd.com/api/v0/search?input=' + movieName + '&include=FilmSearchItem&perPage=1', onload: function(response) { var data = JSON.parse(response.responseText); console.log(data); const letterboxdUrl = data.items[0].film.links[0].url; document.querySelector('h1.elementor-heading-title').innerHTML += " <a href=\""+ letterboxdUrl + "\"><img src=\"" + LETTERBOXD_ICON + "\"/ width='25px' height'25px'></a>"; }, onerror: function(error) { console.error('Error fetching data:', error); } }); })();