| Name | UrbanDictionary Macro |
|---|---|
| Version | 1.0 |
| Status | Beta |
| Author(s) | Yuen-Chi Lian |
| Homepage | UrbanDictionary Plugin |
| Price | Free |
| License | Open Source (BSD) |
| Download JAR | yuenchi.confluence.plugin.urban-1.0b1.jar |
| Download Source | yuenchi.confluence.plugin.urban-1.0b1-src.tar.gz |
Description/Features
Simple plugin with macros which obtain definition(s) from Urban Dictionary via SOAP.
Requirements
- Apache Axis (shipped with Confluence)
- Apache Xerces (shipped with Confluence)
- My UrbanDictionary SOAP Service
Usage Notes
Currently, the supported macros are:
| Name | Description | Body |
|---|---|---|
| urban-lookup | Retrieves the definition of a term (word) from the UrbanDictionary database | |
| urban-daily-definition | Retrieves the definition of term of the day | |
| urban-random-definition | Retrieves the definition of a random term (1 per request/page) | |
Parameters
These are the supported parameters:
| Name | Description | Value | Sub-parameters | urban-lookup | urban-daily-definition | urban-random-definition |
|---|---|---|---|---|---|---|
| author | Returns the name of the author of this definition | |
|
|
|
|
| definition | Returns the definition of the term | |
|
|
|
|
| example | Returns the usage example(s) of the term | |
|
|
|
|
| template | Forces to use custom template for pretty rendering | See Template section | |
|
|
|
| url | Returns the URL of the term | |
title=name of the displaying hyperlink target=_target/_new/etc. |
|
|
|
| useCache | Uses cached record | 0/1, true/false, yes/no | |
|
|
|
| word | Returns the term being looked up | |
|
|
|
|
Rendering
Plain Text Rendering
Plain text will be returned if one of these parameters is used: author, definition, example, url, word.
Pretty Rendering
Pretty rendering will be turned on if none of the Plain Text Rendering parameters is used. You can use the template parameter to specify the custom template for the rendering.
Template
The default template used for "pretty" rendering is "default", which is not required to be specified using the template parameter. You can add custom templates to this plugin by putting it under WEB-INF/classes/templates/plugins/urban with this naming pattern:
definition-$name.vm
For instance, to use a template named definition-fugly.vm in urban-lookup:
{urban-lookup:template=fugly}foobar{urban-lookup}
Examples
This example produces fancy things as you can see in the screenshot.
h3. {urban-lookup:word}mountain dew{urban-lookup}
|| Definition | {urban-lookup:definition}mountain dew{urban-lookup} |
|| Example | {urban-lookup:example}mountain dew{urban-lookup} |
|| Author | {urban-lookup:author}mountain dew{urban-lookup} |
|| URL | {urban-lookup:url|title=Click here to see more}mountain dew{urban-lookup} |
h4. Pretty
{urban-lookup}mountain dew{urban-lookup}
h3. Daily Definition: {urban-daily-definition:word}
|| Definition | {urban-daily-definition:definition} |
|| Example | {urban-daily-definition:example} |
|| Author | {urban-daily-definition:author} |
|| URL | {urban-daily-definition:url|title=Click here to see more} |
h4. Pretty
{urban-daily-definition:template=default}
h3. Random Definition: {urban-random-definition:word}
|| Definition | {urban-random-definition:definition} |
|| Example | {urban-random-definition:example} |
|| Author | {urban-random-definition:author} |
|| URL | {urban-random-definition:url|title=Click here to see more} |
h4. Pretty
{urban-random-definition:template=default}
Version History
| Version | Comment |
|---|---|
| 1.0b | Try it |

Comments (5)
Nov 28, 2006
Ivan Benko says:
Nice work YuenChi! What about extending this and hooking it up with the babel fi...Nice work Yuen-Chi! What about extending this and hooking it up with the babel fish alta-vista translator? Then you could insert a translation of particular words as well!
Nov 29, 2006
Yuen-Chi Lian says:
Hey Ivan, Thanks mate! BabelfishHey Ivan,
Thanks mate! Babelfish? Good idea.. hey, I will think about it. (:
Now.. where to get the WSDL?
yc
Nov 29, 2006
Yuen-Chi Lian says:
http://www.xmethods.net/sd/2001/BabelFishService.wsdl ychttp://www.xmethods.net/sd/2001/BabelFishService.wsdl
yc
Sep 28, 2007
Brendan Patterson says:
I think you forgot to distribute a package. I'm getting this error: Error forma...I think you forgot to distribute a package. I'm getting this error:
Error formatting macro: urban-lookup: java.lang.NoClassDefFoundError: yuenchi/soap/urban/UrbanDictionarySoapClient
Sep 28, 2007
Yuen-Chi Lian says:
Hi Brendan, Thanks for trying it out. The class is available in the yuenchi.soa...Hi Brendan,
Thanks for trying it out. The class is available in the yuenchi.soap.urban-1.0.jar. See Requirements.
yc