Serchilo on your console

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

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

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]

      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!

if [ -n "$URL" ]
	wget -U "Firefox" -qO - "$URL"

3 thoughts on “Serchilo on your console

  1. 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).

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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