maurice.im

last tweets

more twitter

last flickr


more flickr

Adding TweaK to your Twitter application

Some Twitter programs allow you to setup a custom URL shortener. That is a great thing as this makes you less dependent on whether or not the developer of your Twitter application wants to implement your URL shortener. On the other hand its very nice for the developer, as he does not need to implement an unlimited number of URL shorteners.

Some Twitter applications have problems with implemening TweaK however. This is caused by the fact that TweaK responds with two links. 

If you would shorten maurice.im using the TweaK API using the following  URL: 
http://api.dot.tk/tweak/shorten?long=http://maurice.im

You would get the following response:
http://8zlnb.tk
http://tk./8zlnb

First line is the TweaK domain address, second line is the TK short URL. Some Twitter applications will concat the two strings, resulting in an URL like:
http://8zlnb.tkhttp://tk./8zlnb

Thats an obvious fail :(

To cope with that I have created a little wrapper service that allows you to choose which line you want. 

http://tweak-it.appspot.com/single?long=<long url>&line=<line nr>

<long url> is the url you wish to shorten.
<line nr> is the line number you wish to get as a result.

Shortening maurice.im would be like this:
http://tweak-it.appspot.com/single?long=http://maurice.im&line=2

The result would be:
http://tk./8zlnb

If you would omit the line parameter, it will default to the first line.

Happy TweaKing!

directory support for Dot TK domain forwarding

A number of people that use Dot TK’s free domain forwarding miss the support for directories. They would like a hit on http://example.tk/subdir/ to go to http://example.com/whateverusername/examplepage/subdir/.

There is actually a pretty simple way to do this yourself. If your webserver supports scripting (like PHP in this example), you are basically done. 

Lets say your webpage is hosted at http://domain.com/itsme/. You have registered itsme.tk at Dot TK and configured it to point to your webpage.

Now, you wish to have support for subdirectory /cheese/. In the example you would like http://itsme.tk/cheese/ to load content from http://domain.com/itsme/cheese/.

This is what you would need to do:

1. Rename the index.html page in the root directory of your website to index.php.

2. Insert the following code in top of that index.php:

<?php
    // get the referer url    
    $ref = $_SERVER['HTTP_REFERER'];
    // get the index of the 3rd /
    $pos = strpos($ref, "/", 8) + 1;
    if ($pos > 0) {
        // if found, get whatever there was after the /
        $path = substr($ref, $pos);
        if ($path != '') {
            // redirect browser to whatever current url + given path.
            $url = $_SERVER['REQUEST_URI'] . $path;
            header("Location: " . $url);
        }
    }
?>

3. Save the file.

4. You are done!

Not only will http://itsme.tk/cheese/ resolve to http://domain.com/itsme/cheese/, other requests like http://itsme.tk/index2.html would actually load the content of http://domain.com/itsme/index2.html.

What the above lines of PHP code do is the following. First, it reads the HTTP_REFERER variable from the webservers environment. This value holds the value of the URL entered by the website visitor. Secondly, it checks if this request has some text behind the / just right after the domain. If it does, it will forward the visitors browser to the requested page.

A note: Your webserver needs to be configured to allow php files as index files. How to do that is outside of the scope of this document, but should not be too hard.

Tweak in Twitter

More TweaK & javascript fun!

Sometimes when I post something on Twitter, I dont want Twitter to bit.ly my long url. I want to TweaK that. But I was too lazy to go to tweak.tk and post it there.

So.. I created a bookmarklet for it. Basically it works like this:

  1. You drag this bookmarklet “tweak urls” to your bookmarklets spot (IE users do the difficult thing).
  2. You go to twitter.com and start typing your new status message.
  3. Before hitting update, you hit your new bookmarklet!
  4. Any URL in there will magically be tweaked and the status message will be altered.
  5. Then you press Update. hooray! posted!

Ill work on brizzly support, since thats the twitter client I seem to be using more and more.

The bookmarklet supports Brizzly now as well! This means you can shorten URLs you type within brizzly as described above. happy shortening!

Ive tested the bookmarklet on FF and IE 7.0. Let me know if it works for you!

tweak-it bot++!

Remember my earlier post about a tweak-it bot? Well.. ive added wave support to it! Just add tweak-it@appspot.com to your contacts and pass it urls. you’ll get tweaked answers! :)

update: dont want to shorten long urls, but resolve tweaked domains? aye! supported!

Some years back I had this project: Thumbs Up! A website dedicated to images having people showing thumbs up. I stopped with the project because I needed to switch my sites to a new web server without PHP support.
At random times people would ask me when the site would be back up.. I kept promising..
Today is the day! I ported the project to Googles App Engine, making it more stable ;) I already uploaded all old images making it a fun browsing thing already.
Note that this is just the initial port.. I have some stuff to do and will add some features..
Now go to http://thumbsup.tk! Have fun!

Some years back I had this project: Thumbs Up! A website dedicated to images having people showing thumbs up. I stopped with the project because I needed to switch my sites to a new web server without PHP support.

At random times people would ask me when the site would be back up.. I kept promising..

Today is the day! I ported the project to Googles App Engine, making it more stable ;) I already uploaded all old images making it a fun browsing thing already.

Note that this is just the initial port.. I have some stuff to do and will add some features..

Now go to http://thumbsup.tk! Have fun!

Just had some fun combining Dot TK&#8217;s TweaK API with Google App Engine&#8217;s XMPP support.
The result is a jabber-bot that you can talk to. In most cases it wont understand you, but if you pass it an URL, it will shorten that using Dot TK&#8217;s TweaK.
Go to http://tweakbot.tk/ and ask the bot to invite you. After accepting the invitation, have it rename some urls for you!

Just had some fun combining Dot TK’s TweaK API with Google App Engine’s XMPP support.

The result is a jabber-bot that you can talk to. In most cases it wont understand you, but if you pass it an URL, it will shorten that using Dot TK’s TweaK.

Go to http://tweakbot.tk/ and ask the bot to invite you. After accepting the invitation, have it rename some urls for you!

There is a MAUI WAP Browser! :)

There is a MAUI WAP Browser! :)

Traffic generated from Twitter

I was wondering how much traffic one Twitter post would generate,
and more importantly, I was wondering *who* would visit.. So I simply
created a text file, tweeted it and checked the access logs.

http://twitter.com/mauriez/statuses/2929340532

Message posted at 30/Jul/2009:14:43:02 +0200
(local time on box where I checked the logs)

Access log shows this:
66.249.68.198 - - [30/Jul/2009:14:43:48 +0200] "GET /tt.txt HTTP/1.1" "-" 61 61 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"

174.129.91.213 - - [30/Jul/2009:14:43:57 +0200] "GET /tt.txt HTTP/1.1" "-" 61 61 "-" "Python-urllib/2.5"

91.121.123.191 - - [30/Jul/2009:14:43:57 +0200] "HEAD /tt.txt HTTP/1.1" "-" - - "-" "Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8) Gecko/20051128 SUSE/1.5-0.1 Firefox/1.5"

75.101.156.169 - - [30/Jul/2009:14:43:59 +0200] "HEAD /tt.txt HTTP/1.1" "-" - - "-" "AideRSS 2.0 (postrank.com)"

174.129.89.199 - - [30/Jul/2009:14:44:08 +0200] "GET /tt.txt HTTP/1.1" "-" 61 61 "-" "Python-urllib/2.5"

80.46.93.186 - - [30/Jul/2009:14:44:10 +0200] "GET /tt.txt HTTP/1.1" "-" 61 61 "http://twitter.com/" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.12) Gecko/2009070611 Firefox/3.0.12"

89.151.84.35 - - [30/Jul/2009:14:44:10 +0200] "GET /tt.txt HTTP/1.1" "-" 61 61 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6 TweetmemeBot"

79.99.6.106 - - [30/Jul/2009:14:44:11 +0200] "HEAD /tt.txt HTTP/1.1" "-" - - "-" "Twingly Recon"

174.129.111.78 - - [30/Jul/2009:14:44:11 +0200] "HEAD /tt.txt HTTP/1.1" "-" - - "-" "PycURL/7.18.2"

89.151.84.35 - - [30/Jul/2009:14:44:12 +0200] "GET /tt.txt HTTP/1.1" "-" 61 61 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6 TweetmemeBot"

208.74.66.43 - - [30/Jul/2009:14:44:13 +0200] "GET /tt.txt HTTP/1.0" "-" 61 61 "-" "Mozilla/5.0 (compatible; Butterfly/1.0; +http://labs.topsy.com/butterfly.html) Gecko/2009032608 Firefox/3.0.8"

91.121.89.155 - - [30/Jul/2009:14:44:22 +0200] "HEAD /tt.txt HTTP/1.1" "-" - - "-" "PycURL/7.19.3"

75.101.196.118 - - [30/Jul/2009:14:44:27 +0200] "GET /tt.txt HTTP/1.1" "-" 61 61 "-" "Twitturly / v0.6"

91.121.53.183 - - [30/Jul/2009:14:44:56 +0200] "GET /tt.txt HTTP/1.1" "-" 61 61 "-" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.5) Gecko/2009011817 Gentoo Firefox/3.0.5"

I have cut out the requests that were not for tt.txt .. but its amazing
how many automated hits you get after a simple post!

MonaTweeta II - Mona Lisa encoded in a tweet!

MonaTweeta II - Mona Lisa encoded in a tweet!

Old! Resolving shortened URLs

Sometimes you just think of something, start it, and then discover that others have been doing the same. My latest example of this is resolvurl.com.

As I was thinking about shortening URLs and the fact that there quite some services out there, I started wondering about “the other way around”. How to resolve URLs for what they really are.

Without proper investigation (who wants to investigate when feeling all fired up on an idea) I started working on that and then bumped into longurlplease.com. Exactly what I wanted to do! :)

Instead of re-inventing the wheel Ill utilize the longurlplease API. Gives me more time to think of something fun to put around it. .. Probably only to find out someone else already did :)