Shortcut URLs

A shortcut URL may contain placeholders. This page is about them.

Example

Consider for instance the URL of the Google shortcut:

https://www.google.com/search?hl={$language}&q={%query}&ie=utf-8

It contains 2 placeholders: {%query} and {$language}.

Placeholders

Example Will be replaced with Available

Placeholders for arguments

{%foobar}

argument from query.

If there is more than one argument placeholder, their order in URL also defines the expected order in the shortcut query.

always
{%foobar|encoding=iso-8859-1}

... with encoding specified. See Input encoding below.

always
{%Datum|type=date|output=Y-m-d} {%Ziel|type=city}

... with a specified type. See Argument types below.

always
{%IATA-Code|transform=uppercase}

... with a transformation definition. See Transforming below.

always

Placeholders for variables

{$language} current language namespace always
{$user:name} name of current user only when calling via https://www.findfind.it/u/[username]
{$now|output=Y-m-d} current date and time, attribute output defines the output format which must be based on PHP's date() format. Default is Y-m-d. always

Input encoding

The input encoding, like in {%foobar|encoding=iso-8859-1}, defines in which way the user arguments shall be encoded before they replace the placeholders {%foobar}. Defaults to UTF-8.

Input encoding Passed through functions Example input Example output
UTF-8 mb_convert_encoding()rawurlencode() foo ä bar/ foo%20ä%20bar%2F
ISO-8859-1 foo%20%E4%20bar%2F
... or any of the supported encodings  
none http://example.com/ http://example.com/

Argument types

If an argument type is specified, like in {%foo|type=city} the argument will be processed according to the type.

Type Conversion Example input Example output Explanation
date The input will be parsed as a date.
  • American and European inputs will be distinguished.
  • An input containing only a number will be assumed as a day of month.
  • A date in the future will be enforced.
  • Also relative inputs are possible.
  • Weekday abbreviations are understood, too. The language is assumed from the current language namespace, these languages are available.
  • With the attribute output, an output format based on PHP's date(); can be specified. Defaults to Y-m-d.
7.6. 2015-06-07assumes German format
7/62015-07-06assumes American format
72015-06-07assumes current month & year
12015-07-01enforced future date: increases month and even year if computed date would be in past otherwise
+102015-06-17today plus 10 days
-52015-06-02today minus 5 days
mo2015-06-08next Monday
time The input will be parsed as a time.
  • Hours and minutes can be separated by . or :.
  • Only hours can be provided.
  • Relative hours work, too.
  • For user consoles (called via /u/USERNAME), the timezone is assumed from the user's settings. For others, it can also be set via the GET parameter &timezone=. Defaults to UTC.
  • With the attribute output, an output format based on PHP's date(); can be specified. Defaults to H:i.
11.00 11:00Hours and minutes
1111:00only hour given
+213:002 hours from now
city The input will be parsed as an abbreviation for a city, according to these mappings.
  • Abbreviations are mostly based on vehicle registration plate codes (e.g. for Germany, Austria and Ireland). Others are made up (e.g. for Czech Republic).
  • The country is assumed from the current country namespace. A different country can be forced with a 2-letter or 3-letter country code.
  • Suggestions for new mappings are welcome, please leave a Github ticket.
b Berlinif current country namespace is deu (Germany)
at.w Wienforcing an Austrian city
aut.w Wienforcing an Austrian city

Transforming

Finally, with {%foo|transform=uppercase} the output string can be transformed.

Property Conversion Example input Example output Explanation
uppercase The output will be uppercased. sxf SXF Makes sure all letters are uppercase. Using PHP's mb_strtoupper().
lowercase The output will be lowercased. Sxf sxf Makes sure all letters are lowercase. Using PHP's mb_strtolower().