Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yanglr/3b76229aa3015c7777e3baca6fd49732 to your computer and use it in GitHub Desktop.
Save yanglr/3b76229aa3015c7777e3baca6fd49732 to your computer and use it in GitHub Desktop.
Script to get YouTube Channel RSS Feed (Add to Greasemonkey or Tampermonkey)
// ==UserScript==
// @name Get Youtebe RSS
// @namespace http://tampermonkey.net/
// @include https://*youtube.com/*
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @version 0.1
// @description try to take over the world!
// @author Bravo Yeung
// @grant none
// ==/UserScript==
(function() {
'use strict';
for (var arrScripts = document.getElementsByTagName('script'), i = 0; i < arrScripts.length; i++) {
if (arrScripts[i].textContent.indexOf('externalId') != -1) {
var channelId = arrScripts[i].textContent.match(/\"externalId\"\s*\:\s*\"(.*?)\"/)[1];
var channelRss = 'https://www.youtube.com/feeds/videos.xml?channel_id=' + channelId;
var channelTitle = document.title.match(/\(?\d*\)?\s?(.*?)\s\-\sYouTube/)[1];
console.log('The rss feed of the channel \'' + channelTitle + '\' is:\n' + channelRss);
$('#subscriber-count').append('&nbsp;&nbsp;<a href="' + channelRss + '">RSS Link</a>')
break;
}
}
})();
@yanglr
Copy link
Author

yanglr commented Apr 25, 2019

Get RSS of your youtube channel.

@eyadsibai
Copy link

I installed it ... not sure how to use it!? what should I click?

@UnknownSkyrimPasserby
Copy link

UnknownSkyrimPasserby commented Jul 29, 2020

@eyadsibai
In developer console, its look like:

The rss feed of the channel 'TheHodgetwins' is:
https://www.youtube.com/feeds/videos.xml?channel_id=UC69y0hZJEiF_drrxE50VLTQ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment