Last active
March 24, 2016 16:03
-
-
Save jphase/3274d351d8e4dac691ba to your computer and use it in GitHub Desktop.
Clear Facebook Cached Images on Current URL (Bookmarklet)
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
javascript: (function() { | |
var jquery = document.createElement('script'); | |
jquery.setAttribute('src', 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js'); | |
document.body.appendChild(jquery); | |
jQuery.post( 'https://graph.facebook.com', { | |
id: window.location.href, | |
scrape: true | |
}, function(response) { | |
if ( typeof response == 'object' && response.hasOwnProperty('url') && response.hasOwnProperty('image') ) { | |
var msg = 'Successfully cleared ' + response.image.length + ' cached image' + (response.image.length > 1 ? 's' : '') + ' from Facebook:' + "\n\n"; | |
response.image.forEach(function(value, index, array) { | |
msg += value.url + "\n"; | |
}); | |
alert(msg); | |
} else { | |
alert("No cached Facebook images found at:\n\n" + window.location.href); | |
} | |
console.log(response); | |
}); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment