Posts Tagged ‘tweetshrink’

Human Readable Text Compression

As a Web Service
TweetShrink, a web service from TRNSFR, uses a database of common instant / text messaging abbreviations to reduce the number of characters in a tweet. It's essentially a human-readable compression algorithm. For example, "Some text to shrink" becomes "sum text 2 shrnk" when passed through their API.
But it doesn't enforce Twitter's 140 [...]

TweetShrink gem for Ruby

TweetShrink's API is so simple that this gem barely adds anything on top of HTTParty, but here it is.

require 'rubygems'
require 'tweetshrink'

t = TweetShrink.shrink "One wonders why"
# t['difference'] => 4
# t['text'] => "1 wonders y"
# t['original_text'] => "One wonders why"

You can get it from my github account, here, or via rubygems like
$ sudo gem install logankoester-tweetshrink
Enjoy.