Skip to content

Instantly share code, notes, and snippets.

@alexwybraniec
Last active November 15, 2016 13:07
Show Gist options
  • Save alexwybraniec/4078149 to your computer and use it in GitHub Desktop.
Save alexwybraniec/4078149 to your computer and use it in GitHub Desktop.
Get short link
<a href="javascript:void(function(){var p=$('body').attr('class').match(/postid\-(\d+)/);if(p!=undefined)alert('The shortlink of this post is\n\nhttp://www.dezeen.com/?p='+p.pop());else alert('Post ID not found');})()">Get short URL</a>
Get post id
<a href="javascript:void(function(){var p=$('body').attr('class').match(/postid\-(\d+)/);if(p!=undefined)alert('The id of this post is '+p.pop());else alert('Post ID not found');})()">Get post id</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment