Greasy Fork

Greasy Fork is available in English.

Filmweb.pl - Check on IMDb and RottenTomatoes

Adds buttons to imdb.com and rottentomatoes.com

当前为 2023-03-31 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name           Filmweb.pl - Check on IMDb and RottenTomatoes
// @name:pl        Filmweb.pl - Zobacz na IMDb i RottenTomatoes
// @namespace      http://greasyfork.icu/users/124677-pabli
// @version        0.4
// @description    Adds buttons to imdb.com and rottentomatoes.com
// @description:pl Dodaje przyciski do imdb.com i rottentomatoes.com
// @author         Pabli
// @license        MIT
// @match          http*://www.filmweb.pl/serial/*
// @match          http*://www.filmweb.pl/film/*
// @icon           https://icons.duckduckgo.com/ip3/www.filmweb.pl.ico
// @grant          GM_addStyle
// ==/UserScript==

(function() {
    'use strict';

let ogTitle = document.querySelector('.filmCoverSection__originalTitle')
let title = ogTitle ? ogTitle.innerText : document.querySelector('.filmCoverSection__title').innerText
title = encodeURIComponent(title)
let year = document.querySelector('.filmCoverSection__year').innerText
let section = document.querySelector('.filmCoverSection__filmPreview')
let path = window.location.pathname.split('/')
let movieTv = path[1] === 'film' ? 'movie' : 'tv'

function link(search,website,name) {
    let button = `<a href='${search}' title='Zobacz na ${website}' id='zobaczna' target='_blank'><img src='https://icons.duckduckgo.com/ip3/www.${website}.ico'><span>${name}</span></a>`
    section.innerHTML += button
}

link(`https://www.imdb.com/find?q=${title} ${year}`, 'imdb.com', 'IMDb')
link(`https://www.rottentomatoes.com/search/?search=${title} ${year}`, 'rottentomatoes.com', 'Rotten Tomatoes')
link(`https://www.metacritic.com/search/${movieTv}/${title}/results`, 'metacritic.com', 'metacritic')
link(`https://upflix.pl/${title}`, 'upflix.pl', 'upflix')
link(`https://www.boxofficemojo.com/search/?q=${title} ${year}`, 'boxofficemojo.com', 'BoxOfficeMojo')

GM_addStyle(`
#zobaczna {
    display: inline-flex;
    align-items: center;
    margin-top: 2rem;
    margin-right: 5px;
    color: #ccc;
    border-radius: 0.125rem;
	border: 1px solid var(--main-border-color, rgba(172, 172, 172, .3));
	transition: border-color .3s cubic-bezier(.25,.46,.45,.94);
    padding: 5px 10px;
}
#zobaczna:hover {
    border-color: #888;
}
#zobaczna img {
    width: 16px;
    margin-right: 5px;
}
`)

})();