twtdict, because I love words
I made something recently. Something I wasn’t sure anyone would really care about or use. I’m still not sure about that, actually. But, it seems to be getting some positive feedback from those that have stumbled across it. It’s called twtdict.
Sometime in the past couple of weeks I was reading in Hell’s Kitchen (yes, I read in the bar sometime. The white noise of a bar makes it easy to concentrate) when I came across a word I was unfamiliar with: sybaritic. I’ve since learned that it means “devoted to or marked by pleasure and luxury.” At time though, I didn’t have access to a dictionary. I don’t have a smartphone of any kind, so looking it up online was not an option. That may not be a big deal for some people, but, without tooting my vocabularic horn too much, I don’t often run into words that I either don’t know or can’t reason out the definition for based on root and/or context. When I do, it makes me furrow my brow and wish my memory were better so I could look it up later.
That’s when it hit me: What if there was a way that I could tweet the word and have the definition sent back to me in a direct message? Could there be a service like that available? If not, could I do it? Would anyone care? Why is the sky blue?
When I got home, I looked online for “twitter dictionary” and all I could find were actual Twitter dictionaries, lists of Twitter terms and trending topics. First hurdle crossed. If I did it, I wouldn’t be stepping on anyone’s toes.
Next thing to figure out was whether or not I could do it. I already had a domain and webspace, so that was easy. I looked around online and found a simple Twitter class for accessing the Twitter API. That part was easy. Next, I needed an API for a dictionary, to use to look up the word. This took a little longer. I found an article someone saying Google had one, but it’d been long since updated with a “don’t use this API, it’s not actually public” statement from Google. I found one for the Cambridge dictionary, but that wasn’t really an API per se, and tended to return a full HTML document.
Then I found Wordnik. They had an actual API. It’s still in alpha but it’s quick and it’s very easy to use. The rest was relatively easy, just a lot of parsing XML and slicing and dicing strings. Tweet a word, you’ll get a definition… most of the time.
There are still some issues. Some of it with my code, some with the Wordnik API. Currently I grab the first definition returned by Wordnik. This isn’t always the best definition. Take “hope” for instance: n. A sloping plain between mountain ridges. Not quite the first thing you think of when you think of “hope.” Also, some words only return one definition when looked up by the API, or none at all. Wordnik is still working on that end.
It’s not perfect, but it works. For now. Should it take off and get popular, I might run into blacklisting issues with Twitter and/or Wordnik, so that will need to be addressed at some point. Still, it’s been a fun project and I’m definitely looking forward to continuing to refine it. And, with any luck, people out there will find it useful.
Facebook comments:
Nice work!
[…] This post was mentioned on Twitter by John McGrath, Michael Howland. Michael Howland said: I wrote something called “twtdict, because I love words”. It can be found here: http://is.gd/b7833 […]
You might want to look at my “Tweetionary” that has been under construction for some months now.
http://thewordguy.wordpress.com/tweetionary
It’s an offshoot of my daily tweets that provide a word, its definition, and an etymology — all under 140 characters or less. I’ve always thought a Twitter-based dictionary service would be fun — send the word via Twitter to the Tweetionary and get a definition. Sounds like you are thinking the same!
My growing Tweetionary is designed to fit the Twitter 140 character limit, so if you wanted to tap into it, it’s sitting there and growing at the rate of maybe 15 – 20 words per week (I only have time to post two or three per day).
Anyhow, I’m a linguist, not a programmer, so I’m not really into the ins and outs of APIs and databases, but I could be
Russell: I might indeed look into your Tweetionary, if the words are easy to access. Work blocks wordpress.com so I can’t check it out from here, but I will when I get home.
And yes, it has been fun. I love that I can get a definition for just about any word wherever I am, without having to carry around a dictionary, and (in my case) without having a smart phone with instant-on internet.