view bin/google @ 9572:98c473a71c18

<fizzie> ` mv airport bin/airport-lookup; mkx \'bin/airport//airport-lookup any "$*"\'; mkx \'bin/icao//airport-lookup icao "$*"\'; mkx \'bin/iata//airport-lookup iata "$*"\'
author HackBot
date Sun, 30 Oct 2016 23:43:47 +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