Created
June 14, 2012 16:25
-
-
Save moritz/2931318 to your computer and use it in GitHub Desktop.
URL mangling for YAPC::NA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use 5.010; | |
my $url = 'http://ics.webcast.uwex.edu/mediasite/Viewer/?peid=8d476c840c5e4c6a84ec2ccf33a38ee41d'; | |
if ($url =~ /peid=(\w+)/) { | |
my $peid = substr($1, 0, -2); | |
my $new = join '-', unpack '(A8)(A4)(A4)(A4)(A*)', $peid; | |
say "http://video.ics.uwex.edu/$new"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment