Android Arsenal Feed Link to Github Redirection

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

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                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;
  }
}