Created
September 4, 2013 06:28
-
-
Save ItsMeooooooo/6433384 to your computer and use it in GitHub Desktop.
Extract the real URI from google
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
#!/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