Posted by markwk on September 11, 2011 at 1:33pm
This afternoon I threw together a super simple embedded dictionary using WordReference.com. Nothing fancy just two options to set and a block you can put wherever you need that toggles to open an iframe to search definitions. Here's the code: https://github.com/markwk/embed_wr_dictionary
I thought it might be useful for some edu folks out there.

Comments
English > Arabic is not available in the drop-down list
Hi Mark,
I have just installed it and I do not see English<>Arabic out there. How can I add this to the list? I hope you can help me out with this.
Kind regards,
Mohamed
Mohamed, at the time I
Mohamed, at the time I created this there wasn't an embedded option for Arabic. I don't even recall if WordReference.com had an Arabic option then either.
To add this shouldn't be hard at all though. Just check in the code and add the line for english<>arabic.
If you get it to work, please tell me... I'll update the code accordingly.
Thanks Mark! Under
Thanks Mark! Under "$dict_options = array", I added the following line:
"enar" => "English<>Arabic",
but it show "English<>Turkish". Maybe it is a cache issue because the first time I edited the file, I used "entr" => "English<>Arabic". I am not sure. I added it correctly now and I opened in another browser and it still displays "English<>Turkish" by default.
By the way, is there a way to grab results from Word Reference in Views results? I am talking here about a terminology website and when you search or 'tradition' for example in Views search, it will grab results from the database and at the same time it an display results coming from Word Reference or any other dictionary website. Do you think there is a module that can do this? Maybe web services? I am not sure.
Ok. I got it. I suppose it
Ok. I got it. I suppose it would be possible to add a special views handler that could then be used to take another field and pass that as an argument to pull in the definition from WordReference. Probably could also be done via a bit of a javascript too.
wordreference api
It is me again, Mark. I thought you might find this interesting.
http://www.wordreference.com/docs/api.aspx
Taxonomy synonyms
Good catch finding the API. Guess that would mean one couldn't call this project super-simple anymore though :)
One application that immediately comes to mind is using the wordreference APi to automatically map multilingual synonyms for taxonomy terms. If you have a multilingual site that could be interesting.
Yeah, I saw they now offer an
Yeah, I saw they now offer an API for accessing their dictionary. This didn't exist 6 months ago or so. Sounds cool. In my current use case, I don't see this as necessary. I just offer a multilingual dictionary so students can look up words while they read an article or watch a video.
I didn't check the rules on this one, but most APIs don't allow long-term storage of their data, normally just 24-hours and generally they encourage you just to call the API whenever you need the data. As such, it would be pretty difficult to see this implemented with Views since you'd need to locally store the words, then pull into views, then delete it periodically. Probably not a great situation (at least if you want to follow the rules).
Have you checkout my Quizlet module? It use Quizlet's API to access vocabulary lists in a Drupal website. You can basically search lists, then you have a couple embedded study options. Just recently had it upgraded to D7 too.
If we or me or somebody would want to build a module with this WordReference API, then you could consider setting up various calls to the API, then use those calls for whatever situation you wanted, i.e. a search block/page, a highlight word with popup definition, etc.
It indeed would no longer be super simple... Might be fun to do. All depends on how their API is though.
This does not sound simple to
This does not sound simple to a newbie like me. You said something interesting though about the popup definition. Do you have any idea if there is a module that can provide such feature by looking up 'Wordreference' on the fly? There was a company that did that in the past, but they were acquired by Google and they shut down their service. At that time, you could get it hooked up to your site by using cloudflare.com. I do not remember its name right now, sorry :-(
Thanks Mark and I wish you all the best with your projects.
@memoday: sorry for the
@memoday: sorry for the delay. I get too many emails from groups.drupal.org these days, so I missed yours.
Do you mean scrolling over the text and popping up the definition? I don't know anything for this, but sounds cool.
In view of this new API for wordreference, maybe I should upgrade my module to a full project so we can discuss it more there.
Upgraded to Full Project...
Ok. Thanks memoday for the heads up the on the new API and adding in the new Arabic option too.
I've decided to upgrade this github code to a full Drupal project here: http://drupal.org/project/wordreference.
This is still the initial "Super Simple WordReference.com Embedded Dictionary for Drupal 6."
I'm open to the idea of anyone taking this over and expanding it using the full API. Please feel free to post ideas and issues on this in that issue queue.
Thank you so much Mark for
Thank you so much Mark for your great efforts and for taking the decision of making this a full project. I am available for testing and I will do as much as I can to help out. Thanks again!