Re: [dev][surf] searchengine patch against surf git tip

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sat, 5 Jan 2013 13:29:03 +0100

On Fri, Jan 4, 2013 at 10:44 PM, Carlos Torres <vlaadbrain_AT_gmail.com> wrote:
> http://sprunge.us/QMMS
>
> someone requested that on IRC and i had it.
>
> Enjoy!
>

You can also use shellscripting and do something like this:

#!/bin/sh

read input
token=$(printf "%s" "$input" | cut -b 1-2)
stuff=$(printf "%s" "$input" | cut -b 3-)
url="$input"
engine=""
if [ "$token" = "g " ]; then
        engine="https://encrypted.google.com/search?q=%s"
elif [ "$token" = "y " ]; then
        engine="http://www.youtube.com/results?search_query=%s&aq=f"
elif [ "$token" = "w " ]; then
        engine="http://wikipedia.org/wiki/%s"
fi

if [ ! "$engine" = "" ]; then
        url=$(printf "$engine" "$stuff")
fi
printf "Url is: |%s|\n" "$url"


Kind regards (and happy new year),
Hiltjo
Received on Sat Jan 05 2013 - 13:29:03 CET

This archive was generated by hypermail 2.3.0 : Sat Jan 05 2013 - 13:36:04 CET