Skip to content

Instantly share code, notes, and snippets.

@mrmt
Created August 20, 2013 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrmt/6282628 to your computer and use it in GitHub Desktop.
Save mrmt/6282628 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
sub replace{
my $url = shift;
$url =~ s|.*RD_PARM1=||;
$url =~ s|%25(..)|chr(hex($1))|ge;
$url =~ s|\?.*||;
return '\"' . $url . '?uo=4&at=10l4yZ' . '\"';
}
while(<>){
s|\\"(http://click.linksynergy.com/fs-bin/stat[^"]*itunes\.apple\.com[^"]*)\\"|replace($1)|eg;
print;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment