Created
October 12, 2013 13:00
-
-
Save jnv/6949790 to your computer and use it in GitHub Desktop.
Get numerical filenames of pictures in Dropbox gallery (thumbnails view)
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
var thumbs = document.querySelectorAll("#gallery-view-media a[onclick^=Lightbox]"); | |
var ids = []; | |
for (var i = 0; i < thumbs.length; ++i) | |
{ | |
var item = thumbs[i]; | |
var fname = item.href.split('/').pop(); | |
var id = fname.match(/^\d+/)[0]; | |
ids.push(id); | |
} | |
console.log(ids); | |
var txt = document.createElement('textarea'); | |
document.body.insertBefore(txt, document.body.childNodes[0]); | |
txt.value = ids.join("\n"); | |
txt.setAttribute("style","position: absolute; top:0; z-index: 999; height: 10em;"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment