view bin/google @ 3898:d412a26653e5

<fizzie> printf \'%s\\n\' \'#!/usr/bin/env python\' \'import sys\' \'import unicodedata\' \'print u" ".join("[{0}]".format(unicodedata.name(c, "DUNNO")) for c in " ".join(sys.argv[1:]).decode("utf-8")).encode("utf-8")\' > bin/unidecode
author HackBot
date Fri, 11 Oct 2013 13:53:14 +0000
parents e037173e0012
children
line wrap: on
line source

#!/bin/bash
if [ ! "$1" ]
then
    echo 'Google what?'
    exit 1
fi

QUERY=`echo -n "$1" | od -t x1 -A n -w1000 | tr " " %`

lynx --cfg=/dev/null --lss=/dev/null \
     --dump --width=1000 'http://google.com/search?q='"$QUERY" |
    grep -A 4 'Search Results' |
    tail -n 2