TIL that there is a URI scheme for dictionaries, and curl supports it:
curl dict://dict.org/define:mastodon
TIL that there is a URI scheme for dictionaries, and curl supports it:
curl dict://dict.org/define:mastodon
@edsu
The output doesn't look like it's meant for humans, so I always pipe it into a markdown reader.
wotsa ()
{
def="$(curl -s dict://dict.org/define:$1: | grep -vP '^\d\d\d ')";
if [ "$def" = "" ]; then
echo no definition;
else
echo "$def" | mdcat -p;
fi
}
@malin I like it! And I didn't know about mdcat -- now I'm doing the same.
I dropped the -P for the grep since that's not available on MacOS with installing GNU grep. It still seems to work ok?
@edsu The '-P' is for perl-like regex, so I can remove (-v) lines starting with (^) three digits (\d\d\d).
But there are loads of other ways of doing the same thing.
@edsu
Thanks for this info. I started down the rabbit hole and found the wiki page that describes this project.
https://en.wikipedia.org/wiki/DICT
I'm adding this to my list of cool information sources.
now back to what I was planning on doing this morning:-)
@edsu OK this made my day! So cool! :)
is sincerely an amazing project. Kudos to the maintainers!
@edsu wow! https://en.wikipedia.org/wiki/DICT
That's...Really cool. And now I wonder if there are #DotNet libraries for it, and, if not, I kinda wanna write one.
Edit: Golang supports it out of the box: https://github.com/golang/net/blob/master/dict/dict.go
I wonder what other languages have it in the std lib.
