Search code examples
grailsgrails3

How to implement tinyurl on grails 3?


How to implement tinyurl on grails 3?

Or can someone suggest the implementing code of the same plugin which was available in grails 2


Solution

  • You could upgrade the plugin to grails 3, if you really need it. However, the TinyURL API appears to be pretty straightforward: make a GET call and read the response.

    Example:

    "http://example.com/api-create.php?url=http://google.com/".toURL().text
    

    In this case "example" should be replaced with tinyurl, but I cannot post that here because tinyurl links are blocked in SO answers.