IMDb2CL

Chercher la fiche CL d'une fiche IMDb

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

Advertisement:

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

Advertisement:

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name        IMDb2CL
// @namespace   https://www.cinelounge.org/
// @description Chercher la fiche CL d'une fiche IMDb
// @author      tadanobu
// @version     1.93
// @grant       none
// @icon        https://www.cinelounge.org/images/logot.png
// @require     https://code.jquery.com/jquery-3.5.1.min.js
// @match       https://*.imdb.com/title/tt*
// @match       http*://*.imdb.com/title/tt*/?ref*
// @match       http*://*.imdb.com/title/tt*/reference*
// @license MIT
// ==/UserScript==

window.addEventListener('load', showCL);

function showCL() {
    // Extraction de l'ID IMDb
    var match = document.URL.match(/\/tt([0-9]+)\//);
    if (!match) return;
    var movie_id = match[1];

    var h1s = document.getElementsByTagName("h1");

    // Nettoyage du titre
    var title = document.title
        .split('(')[0] // On prend ce qu'il y a avant la parenthèse de l'année
        .trim()
        .normalize("NFKD") // On décompose les caractères accentués
        .replace(/[\u0300-\u036f]/g, "") // On supprime les accents
        .replace(/[^\w\s\']/g, "") // On supprime les caractères spéciaux sauf lettres, chiffres, espaces et apostrophes
        .replace(/[\s\']+/g, "_"); // On remplace les espaces ET les apostrophes par des underscores

    // Construction de l'URL
    var targetUrl = "https://www.cinelounge.org/imdb2cl/" + movie_id + "-" + title;

    for (var i = 0; i < h1s.length; i++) {
        var h1 = h1s[i];
        // On utilise des guillemets doubles pour entourer le href
        h1.innerHTML += ' <a href="' + targetUrl + '" target="_blank"><img src="https://www.cinelounge.org/images/logot.png" style="vertical-align: middle; width: 20px;" title="Fiche CinéLounge" /></a>';
    }
}