Serchilo on your console

September 15, 2008 at 9:51 pm 3 comments

We’ve implemented a little new interface for all console lovers. By calling Serchilo with action=url, for instance:

http://serchilo.net/?action=url&query=g+berlin

you will not be redirected to the target site but will just get its URL:

http://www.google.com/search?hl=en&q=berlin&ie=utf-8

This can be very useful if you have a shell script on your system calling Serchilo with your query, getting the url, downloading the target page and filtering it through html2text.

If this script is called “s” and is located in a directory of $PATH and you’ve installed html2text you can do this:

$ s dbt berlin, hamburg | html2text
===============================================================================
****** Fahrplanauskunft ?bersicht ******

                                                  [frühere Verbindungen]
 +-------------------------+---------------------+----+--------+--------+
 |     Bahnhof ab          | Bahnhof an          | Um |   Ab   |   An   |
 +-------------------------+---------------------+----+--------+--------+
 |  1. Berlin Hbf (tief)   | Hamburg Hbf         |  0 |  05:18 |  07:07 |
 |  2. Berlin Hbf (tief)   | Hamburg Hbf         |  0 |  05:58 |  07:46 |
 |  3. Berlin Hbf (tief)   | Hamburg Hbf         |  0 |  07:18 |  08:57 |
 +-------------------------+---------------------+----+--------+--------+
                                                  [spätere Verbindungen]
  Anzeigeformen
      [Detail]
      [Reisebegleiter]

  Verweise
      Neue Anfrage
      Zur Hauptseite der Deutschen Bahn AG
===============================================================================
Software/Datenstand: HAFAS 5.23.DB.R5.50.c - 15.09.08
Alle Angaben ohne Gew?hr, bei Gleisangaben beachten Sie bitte die ?rtlichen
Hinweise. Hier erreichen Sie uns bei Problemen.

Here’s the script, enjoy!

#!/bin/sh
SERCHILOQUERY="http://serchilo.net/?action=url&query=$@"
URL=`wget -qO - "$SERCHILOQUERY"`
if [ -n "$URL" ]
then
	wget -U "Firefox" -qO - "$URL"
fi

Entry filed under: Uncategorized. Tags: .

New: Paid commands New: Default keyword

3 Comments Add your own

  • 1. ke  |  September 16, 2008 at 7:45 am

    Great idea, thanks a lot!

    Reply
  • 2. dagobart  |  February 14, 2009 at 4:50 am

    Great, that was just what I was looking for. I’d like to build a Twitter bot for serchilo searches, so it’d be possible to look up the next train while your on the “road” (due to Twitter–mobile integration).

    Reply
  • 3. os  |  January 13, 2010 at 11:26 am

    puaaa, i searched about hours for this solution. thank you ! it works perfekt.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Pages

a


Follow

Get every new post delivered to your Inbox.