Skip to content

Instantly share code, notes, and snippets.

@codewizard13
Last active August 29, 2015 14:15
Show Gist options
  • Select an option

  • Save codewizard13/0a592cfe5b7056dbb218 to your computer and use it in GitHub Desktop.

Select an option

Save codewizard13/0a592cfe5b7056dbb218 to your computer and use it in GitHub Desktop.
jQuery - Get YouTube tags and display as comma-separated list - (2013)
/* Get YouTube tags and display as comma-separated list
(Press F12 in your browser to see the results)
@Creator: Eric Hepperle (CodeSlayer2010)
@Date: 07/06/13
@Purpose: With the newest YouTube setup, when I upload a new video and
enter youtube tags, I am unable to select the tags and
copy them to the clipboard. This is troublesome because often I
will develop a set of tags on the fly that I'd like to reuse
in other videos I post. With the current setup, this is not possible.
That is what prompted me to develop this jquery to grab the tags
and print them out in the browser console as a comma-separated
list. Quite simple script, but I hope you find it as helpful as
I did. Cheers. :)
*/
console.clear();
var result = $('div.video-settings-tag-chips-container span.yt-chip');
var out = '';
console.log("I found " + result.length + " YouTube tags.") // how many tags do I have?
$.each(result, function (i, v) {
out += v.title;
//console.log('i = ' + i)
// don't put comma on end of last element
if (i < result.length - 1) {
out += ',';
}
});
console.log(out)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment