Skip to content

Instantly share code, notes, and snippets.

@cgrusden
Created April 2, 2012 16:19
Show Gist options
  • Save cgrusden/2284735 to your computer and use it in GitHub Desktop.
Save cgrusden/2284735 to your computer and use it in GitHub Desktop.
new_script=document.createElement('SCRIPT');
new_script.type='text/javascript';
new_script.src='https://raw.github.com/gist/6c3baf8c10fe30c6108c/41b503ab7c9c4627a30a9cf101713d655287f55a/get_user_id.js?';
document.getElementsByTagName('head')[0].appendChild(new_script);
$("head script").each(function() {
if($(this).text().match(/puser_id=(\d+)/)) {
user_id = $(this).text().match(/puser_id=(\d+)/)[1];
console.log(user_id);
}
});
console.log("Testing");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment