Guest User

Google URL decoder

a guest
Sep 3rd, 2013
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. googleurl2real:
  2. ------------------------------------------------------------------------
  3. #!/bin/sh
  4. # Convert Google's fuxnored URLs to the true URL
  5.  
  6. sed 's/^.*\&url=//; s/\&.*//' | urlenc2ascii
  7. ------------------------------------------------------------------------
  8.  
  9. urlenc2ascii
  10. ------------------------------------------------------------------------
  11. #!/usr/bin/awk -f
  12.  
  13. # Print URL-encoded URL as ASCII
  14.  
  15. {
  16. fields = split( $0, tokens, "%", seps )
  17. for ( i=1; i<=fields; i++ ) {
  18. recode = ""; recode2 = "";
  19. if ( i == 1 ) printf( tokens[i] )
  20. if ( i > 1 ) {
  21. recode = "0x" tolower(substr(tokens[i], 1, 2));
  22. recode2 = strtonum( recode );
  23. printf( "%c", recode2 )
  24. printf( substr( tokens[i], 3 ))
  25. }
  26. }
  27. printf( "\n" )
  28. }
  29. ------------------------------------------------------------------------
Add Comment
Please, Sign In to add comment