Android Arsenal Feed Link to Github Redirection

Redirects the Android Arsenal library links to Github automatically if it is coming from the RSS Feed.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==

// @name                Android Arsenal Feed Link to Github Redirection
// @description         Redirects the Android Arsenal library links to Github automatically if it is coming from the RSS Feed.
// @version             2.1

// @namespace           io.github.ni554n
// @match               https://android-arsenal.com/details/*/*?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+Android_Arsenal+%28The+Android+Arsenal%29

// @supportURL          https://github.com/ni554n/userscripts/issues
// @license             MIT

// @author              Nissan Ahmed
// @homepageURL         https://ni554n.github.io/
// @contributionURL     https://paypal.me/ni554n

// ==/UserScript==

const generalList = document.getElementsByClassName("row project-header")[0]?.firstElementChild

const labels = generalList.getElementsByTagName("dt")

// Grab the Github link and forward to it.
// "Link" label is faster to get to from the end.
for (let i = labels.length - 1; i >= 0; i--) {
  const label = labels.item(i);

  if (label.innerText === "Link") {
    const githubLink = label.nextElementSibling.innerText
    window.location.replace(githubLink);

    break;
  }
}