TIL that there is a URI scheme for dictionaries, and curl supports it:

curl dict://dict.org/define:mastodon

@edsu i sort of forgot that the url scheme exists, but i use the dict client and dict.org on like a daily basis. it is such an amazing resource.
@edsu Oh hey! We use dictd /locally/ for our dictionary (but with the dict client program). Didn't know there was a URI scheme and shit. :3

@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.

@malin yeah, the regex works on MacOS without it.
@edsu @malin too sad Wikimedia projects don't support DICT protocol: https://phabricator.wikimedia.org/T31229
βš“ T31229 Extension to provide access via the dict protocol

@nichtich @edsu @malin oooooh, might be one to revisit now.. 
@theresnotime @nichtich @edsu @malin we need a dicts protocol for dict with TLS.
@malin @edsu or, you could install dictd which comes with a client, and you can also host all the dictionaries available on dict.org locally :D
dict.org

@malin @edsu
On definitions with indented content I was getting formatting garbage displayed with mdcat, so I tried bat ( https://github.com/sharkdp/bat/ ) with plain style instead and got much better results:
GitHub - sharkdp/bat: A cat(1) clone with wings.

A cat(1) clone with wings. Contribute to sharkdp/bat development by creating an account on GitHub.

GitHub
@malin @edsu Nice, `mdcat` is new to me. Which implementation are you running, Rust or Python, or some other?
@fluidlogic @edsu there are multiple? I'm on whatever is in the AUR. Hopefully rust.
@malin @edsu Nice one, thanks. I'm on #ZorinOS (#Ubuntu derivative), and #mdcat is not in the repos on that distro.

@edsu
> that there is a URI scheme for dictionaries

TIL

> and curl supports it

Not surpised at all

@edsu wow. did not know.

Seen this one?

curl http://v2.wttr.in

Weather report for None

@edsu thank you, nice to know!
@edsu Yeah, I always felt there was something fishy about their molar teeth..

@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:-)

DICT - Wikipedia

@edsu i know the former, but not the latter, noice
@edsu Thank you for this. Life changing, spirit enhancing.

@edsu OK this made my day! So cool! :)

is sincerely an amazing project. Kudos to the maintainers!

@edsu Interestingly, if you plug this into Firefox or Safari on MacOS it will bring up the Dictionary application, but won't seed it with the query.
@edsu
Works well on Termux too
@prma

@edsu
@prma

There is the German site dict.leo.org . I don't know how to find out, whether it could work on this site, too.
Any ideas?

@edsu we used to use that at the dictionary publisher I worked for. We had to be terribly careful not to let our internal databases out into the wild
@edsu
Second go delivers a screed from the CIA World Factbook 2002.
@edsu this exists and yet the feed:// uri scheme never caught on! Opening a feed in a feed reader is such a perfect use case for a uri scheme and i'm so mad about this.

@edsu

You can install #dictd and some dictionaries to have this locally:

@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.

DICT - Wikipedia

@edsu how am I only just finding out about this 
@edsu that is so cool. first time i've heard of the #dict protocol.