ni554n / Android Arsenal Feed Link to Github Redirection

// ==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.2

// @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

// @updateURL           https://openuserjs.org/meta/ni554n/Android_Arsenal_Feed_Link_to_Github_Redirection.meta.js
// @supportURL          https://github.com/ni554n/userscripts/issues
// @license             MIT

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

// ==/UserScript==

/* Migration Notice */

console.log(`
 █████  ████████ ████████ ███████ ███    ██ ████████ ██  ██████  ███    ██ 
██   ██    ██       ██    ██      ████   ██    ██    ██ ██    ██ ████   ██ 
███████    ██       ██    █████   ██ ██  ██    ██    ██ ██    ██ ██ ██  ██ 
██   ██    ██       ██    ██      ██  ██ ██    ██    ██ ██    ██ ██  ██ ██ 
██   ██    ██       ██    ███████ ██   ████    ██    ██  ██████  ██   ████ 
                                                                           
                                                                           
`)

console.log(
`Thanks for using "Android Arsenal Feed Link to Github Redirection" userscript downloaded from OpenUserJS.

You are seeing this message because due to a change introduced in OpenUserJS,
future updates to this script will no longer be vaiable.

If you like to get updates in the future, please open your userscript manager program,
and remove the "Android Arsenal Feed Link to Github Redirection" script.

Then head over to this Github link and install this script again.
https://github.com/ni554n/userscripts/blob/master/android-arsenal/feed-link-to-github-redirection#installation

It's very easy to do and will take only 3-4 clicks.

Sorry for the inconvenience!`
);


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