Skip to content

Instantly share code, notes, and snippets.

@samrayner samrayner/
Created Aug 28, 2012

What would you like to do?
Get URL of top Google result for a query
url=$(curl -s --get --data-urlencode "q=$1" $api |
sed 's|"unescapedUrl":"\([^"]*\).*|\1|;s|.*GwebSearch",||')
echo -n $url | pbcopy
echo $url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.