您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Replaces the IGDB button on Backloggd with a cs.rin.ru downolad link
当前为
- // ==UserScript==
- // @name Replace IGDB with cs.rin.ru for Backloggd
- // @description Replaces the IGDB button on Backloggd with a cs.rin.ru downolad link
- // @author Soap
- // @namespace soap.systems
- // @homepageURL https://soap.systems
- // @match *://backloggd.com/games/*
- // @match *://*.backloggd.com/games/*
- // @grant none
- // @version 1.0
- // @icon https://external-content.duckduckgo.com/ip3/www.backloggd.com.ico
- // @license GPLv3
- // ==/UserScript==
- /*
- TODO:
- - add a ProtonDB button if the "released on" section doesn't include Linux
- - scrape the IGDB link to add a gog-games.to link if it exists
- - SteamRip link? Might be kinda redundant
- */
- // We have to get the game name and the right element from the IGDB link because Backloggd doesn't have any meaningful class names
- const link = document.querySelector('a[href^="https://www.igdb.com/games/"]')
- const linkElement = link.parentElement
- if (linkElement) {
- let searchURL = getSearchURL(link)
- linkElement.innerHTML = `Download on <a href="${searchURL}" target="_blank">cs.rin.ru</a>`
- }
- function getSearchURL(link) {
- // examle IGDB link: https://backloggd.com/games/yakuza-6-the-song-of-life
- let searchQuery = link.href.split('/').pop()
- searchQuery = searchQuery.replaceAll('-', ' ')
- searchQuery = encodeURIComponent(searchQuery)
- let searchURL = 'https://cs.rin.ru/forum/search.php?keywords=' + searchQuery + '&terms=all&author=&sc=1&sf=titleonly&sk=t&sd=d&sr=topics&st=0&ch=300&t=0&submit=Search'
- return searchURL
- }