Skip to content

Instantly share code, notes, and snippets.

@aaronjorbin
Forked from georgestephanis/fetch-images.js
Created June 15, 2012 17:10
Show Gist options
  • Save aaronjorbin/2937618 to your computer and use it in GitHub Desktop.
Save aaronjorbin/2937618 to your computer and use it in GitHub Desktop.
Possibility for fetching images for Press This?
var metas = document.getElementsByTagName('meta');
img = document.getElementsByTagName('img'),
send = [],
raw = new Image();
for (m in metas){
if ( metas[m].property == 'og:image')
send.push(metas[m].content);
}
for( i in img ){
raw.src = img[i].src;
if( raw.width >= 50 || raw.height >= 50 ){
send.push( raw.src );
}
}
alert( send.join('||') );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment