Skip to content

Instantly share code, notes, and snippets.

@m0n5t3r
Created April 19, 2018 06:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m0n5t3r/59eeb0a58759e6b490b198bf6e9c0e5a to your computer and use it in GitHub Desktop.
Save m0n5t3r/59eeb0a58759e6b490b198bf6e9c0e5a to your computer and use it in GitHub Desktop.
Add RSS link to bitchute
// ==UserScript==
// @name Bitchute RSS
// @namespace CompletelyUnknown
// @description Adds RSS URL to bitchute.
// @include *://www.bitchute.com/channel/*
// @include *://www.bitchute.com/video/*
// @version 1
// @grant none
// @run-at document-idle
// ==/UserScript==
;(function(){
function add_rss() {
var channel_link = document.querySelector('.video-author a') || (/channel/.test(window.location) ? window.location : document.createElement('a')),
channel_id = channel_link.href.replace(/^.*\/([^\/]+)\//, "$1"),
channel_rss = 'https://www.bitchute.com/feeds/rss/channel/' + channel_id + '/',
rsslink = document.createElement('link');
if(channel_id) {
rsslink.setAttribute('href', channel_rss);
rsslink.setAttribute('rel', 'alternate');
rsslink.setAttribute('type', 'application/rss+xml');
document.head.appendChild(rsslink);
}
}
window.setTimeout(add_rss, 3000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment