Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name [disable when not needed] YouTube - Get all subscribed channels' RSS feed URLs
- // @namespace localhost
- // @description Gets all the channel IDs that you're subscribed to and makes RSS feed links out of them
- // @include https://www.youtube.com/feed/subscriptions*
- // @version 1.0
- // @grant none
- // ==/UserScript==
- /* TO USE THIS SCRIPT:
- * 1. Add it to GreaseMonkey.
- * 2. While logged in on YouTube, visit this URL:
- * https://www.youtube.com/feed/subscriptions
- * 3. The list will pop up in an alert box. Select it all, and copy/paste it
- * into your favorite text editor
- * 4. ???
- * 5. PROFIT!
- */
- // this selector is carefully chosen to gloss over the fact that the channels
- // can be split into two lists depending on the number of channels you're
- // subscribed to and the vertical height of your browser window
- var sublist = document.querySelectorAll( '#guide-subscriptions-container li.guide-channel a.guide-item' );
- var i, channelRSS = new Array( sublist.length );
- var RSSbase = 'https://www.youtube.com/feeds/videos.xml?channel_id=';
- for( i = 0; i < sublist.length; i++ ) {
- channelRSS[i] = sublist[i].getAttribute( 'title' ) + ' - ' + RSSbase + sublist[i].getAttribute( 'data-external-id' );
- }
- alert( channelRSS.join( '\n' ) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement