• ,

    Hacking the Tweet Stream with Cliptext

    Hacking the Tweet Stream with Cliptext

    Share

    Share

     

    Scissors-cutting

    Sharing images that contain significant amounts of text is something quite a number of Twitter users already do. It also seems like a pretty convenient way to โ€œhack the tweet streamโ€ and avoid the 140-character limit.

    Sharing excerpts from online articles is something I do quite often on Twitter. ย These excerpts often exceed Twitterโ€™s 140-character limit, so copying and pasting these pieces of text directly into Twitterโ€™s status message box doesย not always work out as planned. When faced with this 140-character dilemma, one option is toย copy these pieces of text intoย storming.meย and share the generated image. Butย being the โ€œlazyโ€ person that I am, I find thatย process a little tedious. ย Another option is to create a Marc Andreessen-style tweetstorm using an app likeย tweetstorm.ioย orย WriteRack. Unfortunately, this option does not seem particularly suited to sharing a text excerpt especially seeing that one might want to make a short personal comment about the excerpt being shared. Besides, there is that dreadful copying and pasting that Iโ€™m trying very hard to avoid like a plague. Oh, how I eschew the arduous labor involved in copying and pasting.

    I eventually decided to whip up a quick and simple solution for myself by hacking up something I calledย Cliptext. Cliptext is a chrome extension/web app/Android app that converts text selections into images that can be automatically shared on Twitter.ย Itย started out as an excuse to create a chrome extension. Getting some insight intoย Chrome extensions was nice, but craftingย something I knew I wasย actually going to use quite oftenย was even more delightful.

    [youtube http://www.youtube.com/watch?v=qekyQzCk2PM&w=420&h=315]

    I am nowhere near being some sort of Kryptonian super-programmer who knows how to do everything off the bat. I typically need a lot of consultation from multiple sources. My first step to conjuring up Cliptext wasย to readย theย chrome extension getting started guideย  in order toย get a feel for how chrome extensions are structured. Subsequently, I needed to figure out how to add items to Chromeโ€™s context menu on text selections.ย This blog post by Paul Kinlanย helped set me straight in that regard.

    My starting point on the PHP ย side of things wasย this Stack Overflow questionย where someone asked how to convert text to an image. Reading the answers to the StackOverflow question suggestedย thatย PHPโ€™s GD/Image Processing libraryย was the way, the truth and the life.

    Not wanting to mess withย PHP Curl,ย stream contextsย and all that jazz, I decided to take advantage of some of the existingย Twitter API wrappers/libraries. My first attempt wasย to useย codebird-php, but using it felt like swimming in snake-infested muddy water and I got bitten a few times. ย I guess I just could not get it working as quickly as I had hoped. ย I decided to tryย TwitterOauthย as an antidote to all that snake venom from using codebird-php. Pure heaven it was! You should try it sometime.

    Cliptext did not require any complicated code gymnastics and isย as simple as Chrome extensions and web apps get. The intentionally plainย user interface is based onย Skeleton. Putting these resources together, I eventually came up with a working version of Cliptext that met my requirements. Thanks to the various authors of the resources I used.

    I have made the chrome extension available on theย Chrome Web Storeย and theย Google Play Storeย in the hope that it will be useful to someone.ย I have also provided theย source code on my Github page.ย Maybe someone out thereย might be able to learn something from it, just as I have been able to learn from others.

    Editor’s note: David Adamo Jr’s cliptext should not be confused with this clip text.