Advertisement
XT-8147

get_youtube_subscription_rss_feeds.user

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