Created
July 25, 2014 15:27
-
-
Save bpostlethwaite/312ef8ec38f104de6471 to your computer and use it in GitHub Desktop.
extract all the gif img tags from 8tracks
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 tmp = $('<div></div>') | |
$('body').prepend(tmp) | |
tmp.css('height', 400) | |
tmp.css('width', 900) | |
tmp.css('overflow', 'scroll') | |
a = $('#feed-container').find('li') | |
for (var i = 0; i < a.length; i++) { | |
var img = $(a[i]).find('.grid_square .cover')[0] | |
if (!img) continue | |
var src = img.src | |
var idx = src.indexOf('.gif') | |
if (idx !== -1) { | |
src = src.substr(0, idx + '.gif'.length) | |
tmp.append('<div>'+src+'</div></br>') | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment