Last active
August 29, 2015 14:06
-
-
Save cwaring/96763019a99132041265 to your computer and use it in GitHub Desktop.
Grab all the gif urls from the twitter web stream and create a wget formatted download script
This file contains hidden or 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 gifs = []; | |
$('a[data-expanded-url]').each(function() { | |
var url = this.getAttribute('data-expanded-url'); | |
if (url.indexOf('.gif') > -1) { | |
var bipper = $(this).closest('p').find('.twitter-atreply').text(); | |
gifs.push('wget -c ' + url + ' -O "' + (bipper ? bipper + ' - ' : '') + url.replace(/^.*[\\\/]/, '') + '";\n') | |
} | |
}); | |
copy(gifs.join('')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment