CSFD - get series links

Get CSFD series or episodes IDs to clipboard

13.06.2020 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         CSFD - get series links
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Get CSFD series or episodes IDs to clipboard
// @author       Libor Marek
// @match        https://www.csfd.cz/film/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';
    $(document).ready(function () {
        $("#children").append('<div style="float:none;display:block;width:650px;text-align:right;"><input type="button" id="copyEpisodeIDs" value="Kopírovat ID"></div>');

        var EpisodeIDs = '';
        $("#children").children("div").children("ul").children("li").children("a").each(function () {
            var link = $(this).attr("href").trim("/");
            var matches = link.match(/\/(\d+)+[\/]?/g).map(id => id.replace(/\//g, ''));
            EpisodeIDs += matches[1] + "\n";
        });

        $(document).on("click", "#copyEpisodeIDs", function () {
            var $temp = $("<textarea><textarea>");
            $("body").append($temp);
            $temp.val(EpisodeIDs).select();
            document.execCommand("copy");

        });

    });

})();