Break the barriers and tweet longer

Tuesday, November 4, 2014

It's been a while since I found a decent time to post something useful. As the saying goes: There isn't any better time than the present. So while on my way on a super long flight, to rainy Seattle for the MVP Summit, I've got plenty of time to kill. Just wished I had WiFi earlier...


Social media is the next big thing at the moment and with cloud computing driving this, the possibilities are 'virtually' endless (no pun intended). While every social platform has its place, I strongly believe that there are still lots of room for improvement.

Take Facebook for example, back in the day it was [do I dare say] the replacement for MySpace. Let's be honest, it was cool at the time, but nowadays, with the increasing number of junk posts, like Farmville, I personally prefer Twitter as my sharing tool of choice. This is for the simple reason of the clean-cut and down-to-the-point useful information on my terms.

As with anything, there are of course the down sides: Twitter is fundamentally designed to limit the amount of information per post. This is to force the users to really think about they're trying to say. Don't get me wrong, this is a good thing, but sometimes I want the best of both worlds to get my point across properly without using G33k speak that, in some cases make no sense.



Fixing what's broken

There are times when you just want to write a short-ish tweet about something, but are forced to either split up the post in smaller bits or by shrtng ur wrds. #Dont #get #me #started #on #hashtags!

I was thinking about fixing this 'problem' in a creative way, by enabling longer tweets, but still allowing for atomic bits of information.

Say hello to Looong Tweet

The [somewhat] creative way I chose to solve this problem was by building a Google Chrome extension that works with Twitter's web app. In the event of you running out of your hundred and forty characters, the usual 'Tweet' button is replaced by a 'Shorten' one. When this magic button is clicked, with the power of Azure as it's back-end, it will shorten your version, also including a link to the original one so it fits perfectly within the limited characters.

The components

We need: 
1. A mechanism to replace the default 'Tweet' button with the 'Shorten' when the amount of characters exceed the limit. For this, I used pure JavaScript that gets injected into the page by means of a Chrome Extension.


Every Chrome extension also needs a manifest to describe its behavior. Here's the manifest for Looong Tweet:

As you can see from the snippet above, it declares two external resources (script.js and MobileServices.Web-1.2.5.min.js) that it will inject into the DOM when the address in the browser matches 'https://twitter.com/*'. We also need to explicity give permission to the extension for making cross-domain AJAX calls to the mobile service in Azure. 


Remember: The extension is running locally on the browser and not in a server such as localhost

2. Some logic to send the original tweet to Azure, including metadata like the username and avatar.


Here we make use of the Azure Mobile Services JavaScript Client (which I just included as a local resource) to talk to our API in the sky.

3. An API that trims the tweet to the leaner version with a link.

4. A clean website for showing the original tweet with Disqus comments


For this I decided to keep things simple by just using a basic MVC 5 application that uses the WAMS C# client to retrieve the tweet from the API and beautifully displays it without any clutter.


Start using Looong Tweet

This extension is available on the Chrome Web Store right now. So go on, go get it and start tweeting longer tweets that actually makes sense.


That's a wrap

In an upcoming post, I'll show how to package and deploy a Chrome Extension to the store. I hope to make someone wiser who wants to build extensions for Chrome. Please feel free to comment on the content. Your feedback is greatly appreciated.

@FanieReynders


No comments:

Post a Comment

Community

Popular Posts

Archives

Contributors