CSFD - get series links

Get CSFD series or episodes IDs to clipboard

Pada tanggal 13 Juni 2020. Lihat %(latest_version_link).

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==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");

        });

    });

})();