URLify sanitize service
Based on URLify for PHP (a PHP port of URLify.js from the Django project), it
provides a web service to generate URL safe strings starting from generic text.
It accepts the following parameters (via POST or GET):
- string
-
String to be sanitized. Should be UTF-8 and percent encoded.
If empty display the current help page.
Default: <empty>
- mode
-
Method used for sanitization. It can be:
- classic:
URLify filter method is applied. Some symbols from Latin-1 block have been added to URLify map of symbols: ®, ½, ¾, ¼, ², ³, ¹, º, ª.
The default URLify list of words to remove from URLs is ignored, that is, no word is removed from string.
Multiple spaces and "/" (normal slashes, aka SOLIDUS) are converted to "-" (hyphen-minus).
- wiki:
Wikipedia-like URLS: UTF-8 encoded and percent encoded
Multiple spaces and "/" (normal slashes, aka SOLIDUS) are converted to "-" (hyphen-minus).
- auto:
Try to detect chars provided in string.
Use the classic method unless at least one non-ASCII character and non-URLify maps character is found in string
Default: auto
- format
-
Format to be returned. It can assume the values:
- plain:
Plain text.
- json:
JSON string.
Default: plain
- maxlength
- Max length to be returned, it depends on mode.
- mode classic:it is the max lenght of the ASCII string returned
- mode wiki: it is the max length of the input string in UTF-8 characters
Default: 255
Examples
http://apps1.aperion.it/urlify?string=Wikipédia en français
gives wikipedia-en-francais
http://apps1.aperion.it/urlify?string=首页
gives %E9%A6%96%E9%A1%B5