commit ddb55dce90939a8fe1a3da65d0640bc5ec9570ca parent 9e40ef1eb3f0ad207b9792409ef593d3fd9b1e88 Author: Christoph Lohmann <20h@r-36.net> Date: Tue, 25 Jun 2013 15:37:22 +0200 Add script for seeks search engine. Diffstat:
seeks | | | 22 | ++++++++++++++++++++++ |
1 file changed, 22 insertions(+), 0 deletions(-)
diff --git a/seeks b/seeks @@ -0,0 +1,22 @@ +#!/bin/sh +# See the LICENSE file for copyright and license details. + +# TODO: Mirror select if they have more stable servers. +HOST="http://seeks.hydraze.org/search" + +if [ $# -lt 1 ]; +then + echo "usage: `basename $0` search terms ..." + exit 1 +fi + +search=`echo -n "$*" \ + | perl -p -e 's/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg'` +uri="${HOST}?q=${search}&expansion=1&action=expand" + +curl -s "$uri" \ + | xpath -a href \ + '//li[@class="search_snippet"]/div/a[@class="search_cite"]' \ + | grep "^.*://" \ + | uniq +