My TinyUrl plugin released!

Hi,

This is the first plugin I release on my own. This is very very simple, and the main reason to do this, is actually to learn how to deal with your own grails plugins.

It’s called TinyUrl plugin and provides a to your application a service to integrate with TinyUrl URL shrinker website, It’s simple to user, and I recommend to everyone that sends URLs through twitter or other services. Imagine after you insert a post into your blog, you’ll twitter it:

Inject the service

def tinyurlService

and in your action:

def post = new Post(params)
//save your post

def newUrl = tinyurlService.tiny(post.link)

//set your twitter status
twitter.post("I've just posted about ${post.title} right here: ${newUrl}")

That’s it!, visit its page: http://www.grails.org/plugin/TinyUrl

Are you reading my blog’s feed? Be the first to know when I publish some interesting article signing up my feed and following me on twitter!

Thanks!

2 Comments so far

  1. peter on December 8th, 2011

    The TinyurlService is transactional. That is a realy bad idea….

  2. lucastex on December 8th, 2011

    Yeah. This shouldn’t even be a Grails Service. A regular Groovy Object declared under resources.groovy would fit.
    Old code. Bad code. :)

    Thanks anyway.

Leave a Reply

Web Analytics