Skip to content

Instantly share code, notes, and snippets.

@jadaradix
Last active August 29, 2015 14:12
Show Gist options
  • Save jadaradix/39ae8e5e8a9c8e71fb10 to your computer and use it in GitHub Desktop.
Save jadaradix/39ae8e5e8a9c8e71fb10 to your computer and use it in GitHub Desktop.
Stalk people on Facebook. Console this!
var as = ""; var s = false; var t; var f; var c = function() { f = $("#f").contentWindow; var ts = ($(".fbLastActiveTimestamp", f.document).childNodes[0].data == "active now"); if (s != ts) { s = ts; var cd = new Date(); var st = (s ? "online" : "offline") + "," + cd.getHours() + ":" + cd.getMinutes(); console.log(st); as += st + "\n"; } f.location.reload(); }; var stop = function() { clearInterval(t); }; var start = function() { $("body").insertAdjacentHTML('afterbegin', '<iframe id="f" src="https://m.facebook.com/messages/read/?tid=id.289725077795063"></iframe>'); t = setInterval(c, 30 * 1000); }; start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment