Skip to content

Instantly share code, notes, and snippets.

@mtandre
Created February 20, 2015 21:41
Show Gist options
  • Save mtandre/78a946beb8d6dfe79f9c to your computer and use it in GitHub Desktop.
Save mtandre/78a946beb8d6dfe79f9c to your computer and use it in GitHub Desktop.
Facebook Debug: clear Facebook's webpage cache (max 50 per url)
//Facebook Debug: clear Facebook's webpage cache (max 50 per url)
javascript:(function(){ var encodedUrl=encodeURIComponent(window.location.href);function createXMLHTTPObject(){var XMLHttpFactories=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}];var xmlhttp=false;for(var i=0;i<XMLHttpFactories.length;i++){try{xmlhttp=XMLHttpFactories[i]()}catch(e){continue}break}return xmlhttp} function sendRequest(articleUrl){var req=createXMLHTTPObject();if(!req||!articleUrl)return null;req.open("POST","http://graph.facebook.com/",true);req.setRequestHeader("Content-type","application/x-www-form-urlencoded");req.onreadystatechange=function(){if(req.status==200&&req.readyState==4){console.log(req.responseText);var obj=JSON.parse(req.responseText);alert("Article refreshed.\nTitle: "+obj.title+"\nurl: "+obj.url)}};req.send("id="+encodedUrl+"&scrape=true")}sendRequest(encodedUrl);})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment