Skip to content

Instantly share code, notes, and snippets.

@ItsMeooooooo
Created September 4, 2013 06:28
Show Gist options
  • Save ItsMeooooooo/6433384 to your computer and use it in GitHub Desktop.
Save ItsMeooooooo/6433384 to your computer and use it in GitHub Desktop.
Extract the real URI from google
#!/bin/sh
# Convert Google's fuxnored URLs to the true URL
sed 's/^.*\&url=//; s/\&.*//' | urlenc2ascii
------------------------------------------------------------------------
#!/usr/bin/awk -f
# Print URL-encoded URL as ASCII
{
fields = split( $0, tokens, "%", seps )
for ( i=1; i<=fields; i++ ) {
recode = ""; recode2 = "";
if ( i == 1 ) printf( tokens[i] )
if ( i > 1 ) {
recode = "0x" tolower(substr(tokens[i], 1, 2));
recode2 = strtonum( recode );
printf( "%c", recode2 )
printf( substr( tokens[i], 3 ))
}
}
printf( "\n" )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment