Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Easy tinyUrl usage from grails
- * Put this code into bootstrap or somewhere where it will be executed once at startup
- */
- String.metaClass.getTinyUrl = {
- new URL("http://tinyurl.com/api-create.php?url=${delegate.encodeAsURL()}").text
- }
- // now you can use the tinyUrl property of every string to get a tinyUrl for given address
- println "http://www.nabble.com/codehaus---grails-f11860.html".tinyUrl
Add Comment
Please, Sign In to add comment