Skip to content

Instantly share code, notes, and snippets.

@qawemlilo
Created April 11, 2011 12:38
Show Gist options
  • Save qawemlilo/913440 to your computer and use it in GitHub Desktop.
Save qawemlilo/913440 to your computer and use it in GitHub Desktop.
A hacker's bookmarks
/*
****************************************************
COPYRIGHT © 2011 Raging Flame
AUTHOR: Qawelesizwe Mlilo
Email: qawemlilo@gmail.com
****************************************************
*/
function saveBookmark(data){
var requester = false;
if (window.XMLHttpRequest) requester = new XMLHttpRequest;
else if(window.ActiveXObject) requester = new ActiveXObject("Microsoft.XMLHTTP");
if (requester) {
requester.open("GET", data);
requester.onreadystatechange = function(){};
requester.send(null)
}
}
// Response function
function echoMessage(message) {
var msgBox = document.createElement('div');
msgBox.style.position = 'absolute';
msgBox.style.width = '350px';
msgBox.style.height = '20px';
msgBox.style.top = '50%';
msgBox.style.left = '50%';
msgBox.style.margin = '-30px 0px 0px -195px';
msgBox.style.backgroundColor = '#f7f7f7';
msgBox.style.border = '1px solid #ccc';
msgBox.style.color = '#777';
msgBox.style.padding = '20px';
msgBox.style.fontSize = '18px';
msgBox.style.fontFamily = '"Myriad Pro",Arial,Helvetica,sans-serif';
msgBox.style.textAlign = 'center';
msgBox.style.zIndex = 100000;
msgBox.style.textShadow = '1px 1px 0 white';
msgBox.style.borderRadius = "12px";
msgBox.style.boxShadow = '0 0 6px #ccc';
msgBox.setAttribute('onclick','document.body.removeChild(this)');
msgBox.appendChild(document.createTextNode(message));
document.body.appendChild(msgBox);
setTimeout(function(){
try{
document.body.removeChild(msgBox);
} catch(error){}
},3000);
}
echoMessage("Bookmark saved in google docs");
saveBookmark("https://spreadsheets.google.com/formResponse?formkey=dFhsQlBxQmFsSnNvaVpQS3doSzM2MlE6MQ&entry.0.single="+encodeURIComponent(location.href)+"&entry.1.single="+encodeURIComponent(document.title));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment