From beeca40313f68874e05568f4041423c16202e9da Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 30 Aug 2017 17:50:42 +0200 Subject: urlencode all parameters --- dic | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/dic b/dic index 8588998..565de37 100755 --- a/dic +++ b/dic @@ -1,7 +1,6 @@ #! /bin/sh # usage: dic [--lang=LANG] WORD... # where LANG may be one of en, fr, es, it, ch, ru, pt, pl -# multiple WORDs may be seperated by + like this: multiple+words set -euf main() { @@ -26,8 +25,18 @@ main() { } GET() { - curl -sS -b 'LEOABTEST=T; browser=webkit%3B5%3Bajax' \ - "https://dict.leo.org/dictQuery/m-vocab/$lp/query.xml?tolerMode=nof&lp=$lp&lang=$lang&rmWords=off&rmSearch=on&search=$search&searchLoc=0&resultOrder=basic&multiwordShowSingle=on" + curl -GsS \ + -b 'LEOABTEST=T; browser=webkit%3B5%3Bajax' \ + --data-urlencode lang="$lang" \ + --data-urlencode lp="$lp" \ + --data-urlencode multiwordShowSingle=on \ + --data-urlencode resultOrder=basic \ + --data-urlencode rmSearch=on \ + --data-urlencode rmWords=off \ + --data-urlencode searchLoc=0 \ + --data-urlencode search="$search" \ + --data-urlencode tolerMode=nof \ + "https://dict.leo.org/dictQuery/m-vocab/$lp/query.xml" } simplify() { -- cgit v1.2.3