Last active
December 10, 2015 08:28
-
-
Save lyoshenka/4407493 to your computer and use it in GitHub Desktop.
Collect list of YouTube favorites as a JSON string. Run this code in your Javascript console while at https://www.youtube.com/my_favorites
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all = {}; $('#vm-playlist-video-list-ol li').each(function(){ | |
var self = $(this), | |
id = self.attr('id').substring(9), | |
title = self.find('a.vm-video-title-content').text(), | |
url = self.find('a.vm-video-title-content').attr('href').split('&',1), | |
user = self.find('a.yt-user-name').text(), | |
time = self.find('.video-time').text(); | |
all[id] = { | |
id: id, | |
user: user, | |
time: time, | |
url: url.toString(), | |
title: title | |
}; | |
}); console.log(JSON.stringify(all)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment