Twitch RSS Button

Add link to a channel's RSS feed

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

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 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        Twitch RSS Button
// @namespace   http://domain.com/directory
// @description Add link to a channel's RSS feed
// @include     *://*.twitch.*/*
// @run-at document-start
// @version 0.0.1.20191107015349
// ==/UserScript==

setInterval(function()
{

    var cur_url = window.document.URL;

//// Get Rss Link
    var fields = cur_url.split('/');
    var junk1 = fields[0];
    var junk2 = fields[1];
    var twitchlink = fields[2];
    window.channellink = fields[3];
    var junk3 = fields[4];
    window.targetlink = "https://twitchrss.appspot.com/vod/" + window.channellink;

    var btn = document.getElementById('button')

        if (window.channellink != "")
        {
          if (window.channellink != "directory")
          {
              btn.style.visibility = "visible";
          }
          else
          {
              btn.style.visibility = "hidden";
          }
        }
        else
        {
            btn.style.visibility = "hidden";
        }
}, 500);

        //Make Button
    addButton("RSS Feed", rssFeedFn)

    function addButton(text, onclick, cssObj) {
        cssObj = cssObj || {position: 'absolute', bottom: '86%', left:'75%', 'z-index': 3}
        let button = document.createElement('button'), btnStyle = button.style
        document.body.appendChild(button)
        button.innerHTML = text
        button.onclick = onclick
        button.id = "button"
        Object.keys(cssObj).forEach(key => btnStyle[key] = cssObj[key])
        return button
    }


    //Clck Button

    function rssFeedFn()
    {
        if (window.channellink != "")
        {
          if (window.channellink != "directory")
          {
              window.open(window.targetlink);
          }
        }

    }