RSS Feed Finder

Looks for RSS links on the page when there isn't a subscribe button set in the header

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name        RSS Feed Finder
// @namespace   DoomTay
// @description Looks for RSS links on the page when there isn't a subscribe button set in the header
// @version     1.0.1
// @include     *
// @grant       none
// ==/UserScript==

var links = document.links;
var foundLinks = [];

if(!document.querySelector("link[type='application/rss+xml']") && !document.querySelector("link[type='application/atom+xml']"))
{
	for(var i = 0; i < links.length; i++)
	{
		if(foundLinks.includes(links[i].href)) continue;
		if(links[i].href.includes("/feed") && links[i].href.includes("atom")) makeFeedLink(links[i],"application/atom+xml");
		else if(links[i].href.includes("/rss") || links[i].href.includes(".rss") || links[i].href.includes("/feed") || links[i].href.includes(".xml")) makeFeedLink(links[i],"application/rss+xml");
	}
}

function makeFeedLink(link,type)
{
	var newRSSButton = document.createElement("link");
	newRSSButton.rel = "alternate";
	newRSSButton.type = type;
	newRSSButton.href = link.href;
	newRSSButton.title = link.textContent.trim() != "" ? link.textContent.trim() : "RSS Feed";
	document.head.appendChild(newRSSButton);
	foundLinks.push(link.href);
}