Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Make direct video link for YAPC 2012 Live Streams
$(document).ready(function() {
$(".cardLink").each(function() {
var href = this.href;
var video_id = this.href.split('=')[1].replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})..$/, '$1-$2-$3-$4-$5');
var video_link = "" + video_id;
$(this).parent().append('&nbsp;<a href="' + video_link + '">[Video]</a>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment