Tuesday, February 16, 2010

Programmer - Replace urls with the shortened version - Ruby

Programmer Question

Replacing the urls in a block of plain text is done by looking for url regular expressions. I am using string.gsub(regex, "\1") to achieve the same.



I would like to know how to proceed if the shortened url (using api's of any url shortening service) is to be used as the replacement and not the original url.



I am using Ruby.

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails