Skip to content

Instantly share code, notes, and snippets.

@e-orlov
Last active August 29, 2015 13:57
Show Gist options
  • Save e-orlov/9467996 to your computer and use it in GitHub Desktop.
Save e-orlov/9467996 to your computer and use it in GitHub Desktop.
Bookmarklet to check Open Graph Metadata on each page. Requirement: page has JQuery loaded befor.
javascript:$=jQuery;if($('#myogdiv').length!==0){$('#myogdiv').hide().remove();}else{var%20myogdiv=$('<div%20id="myogdiv"/>');$('body').append(myogdiv);$('head%20meta[property^="og:"],head%20meta[property^="fb:"]').each(function(i,el){var%20k=$(el).attr('property');var%20v=$(el).attr('content');$(myogdiv).append('<div><b>'+k+':</b>'+v+'</div>');if(k=='og:image'){$(myogdiv).append('<br%20/><img%20src="'+v+'"/>');}});$(myogdiv).css('position','fixed').css('top','0').css('zIndex',99999).css('padding','0.5em').css('border','1px%20solid%20red').css('backgroundColor','white');}void(0);
@e-orlov
Copy link
Author

e-orlov commented Mar 10, 2014

Add this from here like a bookmark to your browser. Works only if JQuery is loaded. To load JQuery use something like JQuerify: http://www.learningjquery.com/2006/12/jquerify-bookmarklet/ or http://jsfiddle.net/chilly_bang/C2D6K/embedded/result/ or http://jsfiddle.net/chilly_bang/dGu4J/embedded/result/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment