Professional


27
Jun 11

Longer tweets that look good

I kinda like webservices that allow you to create longer tweets, because really, sometimes you just need them a tad bit longer.

There are (only) a few options out there, but the main ones I know are tweetlonger.com and deck.ly, the latter only open to Tweetdeck users. The deck.ly tweet page looks like a web 2.0 ERP business-aligned software page and tweetlonger.com’s tweet page, accompanied by the tl.gd  domain, is just.. well judge for yourself.

Both show the Twitter username and a photo (which you quite have to search for on tl.gd) and that’s it. “Come on!” I thought “I haven’t spend ages on my Twitter design for nothing”.

Well, I didn’t really think that, but it was something along thoses lines and basically:  ”Why is there no longer tweet service that incorporated my Twitter page design?

So I created “Longer Tweets, Get Some!” or commonly known as http://lt.gs.

It’s really simple, you sign in with Twitter (give the app access if it’s the first time you use it) and then you’re ready to go! Breaking the 140-character limit since 2011! Sure, be a rebel, why not!

When your tweet is posted and people follow the short url back, they’ll find something similar to this.

A screenshot of how a tweet on lt.gs would look like.

Some people have already commented on the layout, which they consider ugly, so I’m having artsy people look at it. I’m not really a designer ..


20
Jun 11

Friendly hack of Last.fm and ifttt.com

Last.fm button, made by fotopocket.nl

Update july 25th, 2011: ifttt.com implented the Last.fm channel and triggers.

I’ve already suggested to the guys over at ifttt.com to add the Last.fm API to their channel for us to interect with (and they’re working on it!). However, untill they actually make this, here’s a quick tip (or lifehack) on how to achieve somewhat of a Last.fm channel.

One of the default If This Then That channels is RSS. On your last.fm page you can see your recent tracks but also loved tracks and similar options, these come with a RSS feed; thus you could interact with it.

Your “Favorite Tracks” URL would be something like this: http://ws.audioscrobbler.com/2.0/user/theonewithout/lovedtracks.rss
Where you would want to switch my username (theonewithout) with yours.

Now you can add an action for it. I’m obsessed with twitter, so my action is set to “Post a tweet”.

The ‘command’ looks like this:

I just added "{{EntryTitle}}" to my Last.fm favourites! {{EntryUrl}}

So in the end, our task looks like this:

From (Last.fm) RSS to Twitter

And our tweet like this:

The end result: A tweet

Hope this blogpost can you help you figure out cool stuff!

P.s. All available Last.fm feeds can be found here: http://www.last.fm/api/feeds


19
May 11

Push new value into array with PHP

At work today, my colleague needed to add, or rather ‘insert’, a value into an existing array AND on a specific index. This because we fed it into a JS table sorter thing, once we pulled it through json_encode().

We couldn’t find any existing Array function at php.net, so I decided to make my own version.

At first I wanted it to work with associative arrays too, but it got complicated fast and at the time we didn’t even need it; feature creep. So for now it only works with numeric array keys.

What it does..
First it checks whether the index you supplied ($index) is available in the array ($array), if so, dissects the array in half, starting from the point you supplied ($index) (there’s no default function for this either, so I used array_slice). You now have a ‘first’ and a ‘last’ array. Then you add your value ($value) to the first array, merge both arrays back together, and you’re done!

1
2
3
4
5
6
7
8
9
function array_push_insert($array, $index, $value) {
	if (array_key_exists($index, $array)) {
		$firstArray = array_slice($array, 0, ($index + 1));
		$lastArray = array_slice($array, ($index + 1));
		array_push($firstArray, $value);
		$array = array_merge($firstArray, $lastArray);
	}
	return $array;
}

Example
We call the function and supply it with our original array, the index after which we want our new value to be inserted and the value itself. So in the next example, we want to add the letter “D” after the “B”, and this value’s key is 1. So we send in the array ($array), the key (1) and our new value (“D”).

1
2
3
4
5
6
7
$array = array(
	"A", // 0
	"B", // 1
	"C" // 2
);
 
$finalArray = array_push_insert($array, 1, "D");

So when we print_r() the $finalArray, it looks like this:

Array ( 
[0] => A 
[1] => B 
[2] => D 
[3] => C 
)

16
Apr 11

T-Mobile traffic through http://1.2.3.12

I’m at a place where there’s no internet, so I hooked up my T-Mobile G1 (an HTC Dream) to my laptop through the PdaNet app.

When I was browsing a site, I noticed an image that wasn’t working. So I opened it up in a new tab, where it seemed to work again, but I then noticed the URL. The http:// part of the original source was dropped and replaced by ‘http://1.2.3.12/bmi/’, i.e.: http://1.2.3.9/bmi/www.gerbenjacobs.nl/wp-content/uploads/2011/01/cute-kitten-laughing-64×64.jpg

My first instinct was to ask customer support (god, am I that customer?) followed by Google. I then found this blogpost “T-Mobile rewrites image urls” which is 13 months old, but I never noticed T-Mobile doing this. So they must have recently added this ‘service’ to T-Mobile Netherlands.

T-Mobile Edge

After more research, it turns out that T-Mobile calls this service ‘EDGE’ (Enhanced Data Rates for Global Evolution) and what it does is basically a giant loadbalancer and CDN in one.

When you inspect the IP address it shows up as an Australian server, which shocked me initially, but after some tests I didn’t notice any speed loss. So it must be using some kind of geo-aware content delivery network. (The weird thing is that I can’t seem to trace the IP in Cmd.exe with the ‘tracert’ command, so I have no idea which server they appoint to my geolocation)

Advantages

So how is this ‘enhanced’, you may ask. Well, just look at the following image (probably need to click to enlarge):

Parallel downloads with T-Mobile Edge

It’s hard to see, because it’s not the entire page load, but all of the images (they were avatars on a forum) were loaded simultaneously. I was using Firefox 4 which can handle up to 5 (or was it 8?) parallel downloads at the same time. Then the ‘loadbalancing’ (for lack of a better word) comes to play, using the multiple servers 1.2.3.9 to 1.2.3.13 (great IP address by the way!) it loaded them all. So that’s 5 x 5 (or 8), which is up to 25 (or 40) resources, or forum avatars, at once.

That’s the only advantage I can spot of this so called EDGE service, which came unannounced.

Disadvantages

Then there is the disadvantage, that applies to all proxies in general; single entry point and thus single entry point of failure. So in other words, when their servers get hacked, we have no idea what is being send.

Applying to the single entry point, also means the possibility of tracking. But I doubt that this would be any worse than what Google does, they probably know everything about you already. And maybe the CIA is behind it.. or the New World Order..

However, without going off-topic too much, about 95% of T-Mobile customers wouldn’t mind this (and probably wouldn’t understand it either), but I do wonder why this hasn’t been announced, or why there is so little information about it. I’m not really sure what my opinion on the issue is..
At the moment I’m in favour of it, because I like pages to load quickly, duh! On the other hand I wish there was more transparency, because this is kind of ‘a big thing’.