-
-
Save aaronjorbin/2937618 to your computer and use it in GitHub Desktop.
Possibility for fetching images for Press This?
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 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