<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>http:, ftp:, and &#8230; dict:? &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/2024/09/http-ftp-and-dict/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Wed, 25 Sep 2024 06:09:00 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>http:, ftp:, and &#8230; dict:? &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[http:, ftp:, and ... dict:?]]></title>
		<link>https://shkspr.mobi/blog/2024/09/http-ftp-and-dict/</link>
					<comments>https://shkspr.mobi/blog/2024/09/http-ftp-and-dict/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Wed, 18 Sep 2024 11:34:56 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[internet]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=52349</guid>

					<description><![CDATA[I went for a spelunk through an ancient codebase a few weeks ago which contained a curious regex that I just couldn&#039;t grok.  {&#60;((https?&#124;ftp&#124;dict&#124;tel):[^\&#039;&#34;&#62;\s]+)&#62;}i   I&#039;m familiar with HTTP and FTP. I worked in the mobile industry, so knew that tel:+44... could be used to launch a dialer.  But DICT?!?!?!  It turns out that, lurking on the Internet are Dictionary Servers!  They exist to allow you…]]></description>
										<content:encoded><![CDATA[<p>I went for a spelunk<sup id="fnref:spelunk"><a href="https://shkspr.mobi/blog/2024/09/http-ftp-and-dict/#fn:spelunk" class="footnote-ref" title="v 1: explore natural caves [syn: {cave}, {spelunk}]" role="doc-noteref">0</a></sup> through an ancient codebase a few weeks ago which contained a curious regex that I just couldn't grok<sup id="fnref:grok"><a href="https://shkspr.mobi/blog/2024/09/http-ftp-and-dict/#fn:grok" class="footnote-ref" title="(/grok/, /grohk/, vt. 1. To understand. Connotes intimate and exhaustive knowledge." role="doc-noteref">1</a></sup>.</p>

<pre><code class="language-_">{&lt;((https?|ftp|dict|tel):[^\'"&gt;\s]+)&gt;}i
</code></pre>

<p>I'm familiar with HTTP and FTP. I worked in the mobile industry, so knew that <code>tel:+44...</code> could be used to launch a dialer.</p>

<p>But DICT?!?!?!</p>

<p>It turns out that, lurking on the Internet are <em>Dictionary Servers</em>!  They exist to allow you to query dictionaries over a network.</p>

<blockquote><p>For many years, the Internet community has relied on the "webster" protocol for access to natural language definitions. […] In recent years, the number of publicly available webster servers on the Internet has dramatically decreased.  Fortunately, several freely-distributable dictionaries and lexicons have recently become available on the Internet.  However, these freely-distributable databases are not accessible via a uniform interface, and are not accessible from a single site.</p></blockquote>

<p><a href="https://datatracker.ietf.org/doc/html/rfc2229">The (informal) standard was published in 1997</a> but has kept a relatively low profile since then.  You can understand why it was invented - in an age of low-size disk drives and expensive software, looking up data over a dedicated protocol seems like a nifty<sup id="fnref:nifty"><a href="https://shkspr.mobi/blog/2024/09/http-ftp-and-dict/#fn:nifty" class="footnote-ref" title="nifty \nifty\ adj. 1. Very good; excellent; -- an informal term meaning about the same as {groovy}, sense 1. [informal, 1960's]" role="doc-noteref">2</a></sup> idea.</p>

<p>Then disk size exploded, databases became cheap, and search engines made it easy to look up words.</p>

<h2 id="how-it-works"><a href="https://shkspr.mobi/blog/2024/09/http-ftp-and-dict/#how-it-works">How it works</a></h2>

<p>You can try it out today!</p>

<p>Run this command in your terminal:</p>

<p><code>curl dict://dict.org/d:Internet</code></p>

<p>That will bring back the definition from the server's default dictionary. If you want to look up a word in a <em>specific</em> dictionary - like The Jargon File - you can run:</p>

<p><code>curl dict://dict.org/d:Internet:jargon</code></p>

<p>You can even use it for simple translation tasks. For example, to translate English to Japanese:</p>

<p><code>curl dict://dict.org/d:Internet:fd-eng-jpn</code></p>

<h2 id="what-else"><a href="https://shkspr.mobi/blog/2024/09/http-ftp-and-dict/#what-else">What Else?</a></h2>

<p>Perhaps the easiest way to explore the protocol and server is to use telnet:</p>

<p><code>telnet dict.org dict</code></p>

<p>Type the command <code>HELP</code> and help ye shall receive:</p>

<pre><code class="language-_">113 help text follows
DEFINE database word         -- look up word in database
MATCH database strategy word -- match word in database using strategy
SHOW DB                      -- list all accessible databases
SHOW DATABASES               -- list all accessible databases
SHOW STRAT                   -- list available matching strategies
SHOW STRATEGIES              -- list available matching strategies
SHOW INFO database           -- provide information about the database
SHOW SERVER                  -- provide site-specific information
OPTION MIME                  -- use MIME headers
CLIENT info                  -- identify client to server
AUTH user string             -- provide authentication information
STATUS                       -- display timing information
HELP                         -- display this help information
QUIT                         -- terminate connection

250 ok
</code></pre>

<p>That will allow you to see all the dictionaries available - in a variety of languages - and the various commands you can use with them.</p>

<h2 id="unanswered-questions"><a href="https://shkspr.mobi/blog/2024/09/http-ftp-and-dict/#unanswered-questions">Unanswered Questions</a></h2>

<ol start="0">
<li>Are there any other Dictionary Servers still available on the Internet?</li>
<li>Did the Webster Protocol get specified outside of <a href="https://www.cs.brandeis.edu/~bruncott/elisp/webster19-alpha.el">obscure source code</a>?</li>
<li>Is there something interesting and modern one could do with a DICT server?</li>
</ol>

<div id="footnotes" role="doc-endnotes">
<hr>
<ol start="0">

<li id="fn:spelunk">
<p>v 1: explore natural caves [syn: {cave}, {spelunk}]&nbsp;<a href="https://shkspr.mobi/blog/2024/09/http-ftp-and-dict/#fnref:spelunk" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:grok">
<p>(/grok/, /grohk/, vt. 1. To understand. Connotes intimate and exhaustive knowledge.&nbsp;<a href="https://shkspr.mobi/blog/2024/09/http-ftp-and-dict/#fnref:grok" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:nifty">
<p>nifty \nifty\ adj.   1. Very good; excellent; -- an informal term meaning about the same as {groovy}, sense 1. [informal, 1960's]&nbsp;<a href="https://shkspr.mobi/blog/2024/09/http-ftp-and-dict/#fnref:nifty" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

</ol>
</div>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=52349&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2024/09/http-ftp-and-dict/feed/</wfw:commentRss>
			<slash:comments>16</slash:comments>
		
		
			</item>
	</channel>
</rss>
