Skip to content
Georg Jähnig edited this page Jun 22, 2018 · 36 revisions

trovu – Web shortcuts managed in Git.

trovu is a spin-off from Serchilo / FindFind.it.

trovu allows you to define shortcuts for URLs / websites and then quickly access them in a command-line way, e.g.

  • g berlin – search Google for "berlin".
  • gd london, liverpool – find a route on Google Maps from London to Liverpool.
  • db b, m – find the next * Bahn* train connection from Berlin to Munich.

Differences to Serchilo

  • The shortcuts are kept in text and JSON files in a public Git(hub) repository (this one). Users can also use their own repository, thus:
    • more freedom.
  • trovu's parsing works completely client-side, so no search queries are sent out, only to the actual target site. Thus:
    • faster processing,
    • enhanced privacy.

Step-by-step: How a query is processed

First, lets look at the (example) settings:

  • Namespace URL templates: For every namespace, the template defines where to look for its shortcuts. For site namespaces they point to the repository trovu-data. Optionally, for user namespaces they can point anywhere.
    • o: https://raw.githubusercontent.com/trovu/trovu-data/master/shortcuts/o/{%keyword}/{%argumentCount}.txt
    • de: https://raw.githubusercontent.com/trovu/trovu-data/master/shortcuts/de/{%keyword}/{%argumentCount}.txt
    • .de: https://raw.githubusercontent.com/trovu/trovu-data/master/shortcuts/.de/{%keyword}/{%argumentCount}.txt
    • johndoe: https://example.com/trovu/{%keyword}.{%argumentCount}.txt

Now, lets look at a processing of a query"

  1. A query comes in, e.g. g foobar.

  2. The current namespace setting is o,de,.de,johndoe.

  3. The query is parsed – in the client by Javascript – into

    • keyword: g
    • argument: foobar
  4. Based on the query and the namespace settings, the client Javascript tries to fetch 4 URLs:

  5. From the fetches that succeeded, the results are evaluated in namespace order.

  6. Since already the first text file exists, its URL is used for further processing

    • https://www.google.de/search?hl={$language}&q={%query}&ie=utf-8
  7. The {%query} placeholder is being replace with the query argument foo.

  8. A redirect to the URL is made.

Repositories

This repository contains all the data, e.g.

  • shortcuts
  • mappings (later)

Fork this repository to add or edit shortcuts (and send then a pull request).

This repository contains the web frontend.

trovu-android / trovu-ios / trovu-gtk

Future plans. (Can be picked up by anyone.)

Demo

https://trovu.net/

Clone this wiki locally