mirror of
https://github.com/kmein/niveum
synced 2026-03-16 18:21:07 +01:00
18 lines
413 B
Nix
18 lines
413 B
Nix
{
|
|
writers,
|
|
curl,
|
|
jq,
|
|
}:
|
|
writers.writeDashBin "kirciuoklis" ''
|
|
${curl}/bin/curl -sSL 'https://kalbu.vdu.lt/wp-admin/admin-ajax.php' -F action=text_accents -F body="$(cat)" \
|
|
| ${jq}/bin/jq -r .message \
|
|
| if [ "$1" = "--json" ]
|
|
then ${jq}/bin/jq .textParts
|
|
else ${jq}/bin/jq -r '
|
|
.textParts
|
|
| map(if has("accented") then .accented else .string end)
|
|
| join("")
|
|
'
|
|
fi
|
|
''
|