Hello there. I am Terry and I am a full-time undergraduate based in Singapore. I take photos, write a blog and design websites.

And no, I'm not a teddy bear.

Launching two new sites

After the past few weeks, I was busy with the work I’m getting from my internship position with a local design firm, but I still managed to dedicate enough free time to two sites I was launching. They’re not really community-powered sites, so there’s nothing hyper about it *laughs*

Tweet Archive (link)

Tweet Archive

Tweet Archive

In light of the recent instability of Twitter, especially over the one-month span of the World Cup, I have decided that backing up my tweets on a remote server will be a wise choice. Not only does the remote server helps to archive all the tweets that I have been posting since then, it also creates a searchable tweet archive. Don’t you find it frustrating that even you yourself can’t comb through your own tweets on Twitter web interface?

However, I was only able to retrieve down to the last 3,200 tweets (dating back to August 2009). The 3,200 cap was placed on Twitter API to prevent it from being overloaded with requests… which means I’ve lost around 5000+ of my older tweets, but it’s okay.

I got the idea after Jeff (@perishable) wrote about backing up his tweets during Twitter’s wobbly period. And he has got his tweets backed up already, too.

Jeff's tweet about archiving his tweets

Jeff's tweet about archiving his tweets

What I did wasn’t exactly quite rocket science (maybe except for the regex part):

  1. Upgrade my site to WP3.0, and activate the WP multisite feature. If you’re done with this step, everything will be a lot easier. Note: Please check with your host if they support wildcard DNS, i.e. *.domain.tld. If such a feature is not offered, it’s not all kaboom. Simply create a new WP installation in the subdomain’s root directory.
  2. Install a new child blog pointing to http://tweets.teddy-o-ted.com
  3. Download your Twitter archive – I recommend TweetBackup. Export the latest 3,200 tweets (or less) as an RSS feed and download it. Try to refrain from tweeting between downloading your Twitter archive and the completion of the set up – you wouldn’t want any tweets to fall through.
  4. Import your Twitter archive to your WP installation. If your server is slow, the import script might exceed the 30-second execution time limit and you will encounter a timeout error. Don’t panic. Go to your WP installation and check the earliest tweet that was successfully imported. Return to your RSS file, and remove all entries prior to that, which should shave a sizeable chunk of bytes off the original RSS file. Reimport the file.
  5. Install Alex King’s TwitterTools WP plugin. The plugin has quite a lot of function, but I configured it such that it only imports my tweets and post them. The plugin can also create a tweet from your WP post, but enabling this feature might cause a non-ending loop (although it is claimed that the plugin is designed to avoid such fireball of death, you should be smart enough to avoid it).
  6. Get a theme. Doug has an excellent one, go get it. Alternatively, you can modify any WP themes you want. The theme I am using for my tweet archive is a modification of Sandbox, modeled after Doug’s theme as well.
  7. Regex. If you’re quick, you’ll notice that all imported tweets lack outbound links for @replies and #hashtags. I wrote a short php function to do this. Insert the following lines into your theme’s functions.php file:
    // Makes URLs, @usernames and #hastags in tweets clickable
    function tweet_replies_url_filter($content) {
    	// Prevent premature texturizing
    	remove_filter('the_content', 'wptexturize');
    	// Replaces username with clickable link
    	$pattern_username = '/\@(\w+)/';
    	$replace_username = '@<a href="http://twitter.com/'.strtolower('\1').'">\1</a>';
    	$content = preg_replace($pattern_username,$replace_username,$content);
    	// Replaces hashtag with clickable link
    	$pattern_hashtag = '/\#([a-z][A-Z])(\w+)/';
    	$replace_hashtag = '#<a title="Search Twitter for \2" href="http://search.twitter.com/search?q=\2">\2</a>';
    	$content = preg_replace($pattern_hashtag,$replace_hashtag,$content);
    	/* Uses internal WP command make_clickable to replace URLs with clickable link */
    	$content = make_clickable($content);
    	add_filter('the_content', 'wptexturize');
    	return $content;
    add_filter('the_content', 'tweet_replies_url_filter');

For more information, you can read it up here. Doug has done a great writeup on establishing your own Tweet Archive.

tdy.co (link)

tdy.co - A personal URL shortener

tdy.co - A personal URL shortener

When the .co domain was opened to the general public on the 21st of July, I wasn’t very sure what domain name do I want. The first thing that actually went through my mind was to purchase tmun.co because tmun.com was already parked (and I have no idea why). When searching for available domain names on GoDaddy I decided to try my luck and started jamming the searchform with 3 letter acronyms of my site, my nickname or my other pseudonyms.

Try.co, taken. Tsd.co, taken. Ted.co, taken. Tdy.co, still available. What?!

I jumped. Immediately I billed $26 to my credit card and snagged the domain name before anyone else does. I had no idea what I wanted to do with it until I saw Dean’s tweet about converting his new domain, djr.co, into a personal URL shortener and I thought, hell, why not?

I downloaded a fork of Shaun Inman’s Lessn, developed by Alan Hoogan, called Lessnmore. Lessn is a great simple tool and is a lot lighter than Yourls, but it doesn’t support custom slugs unless I modify the database entry. I dug around and arrived at Lessnmore. It’s an extension of Lessn, and has a little more functionality with the same API hooks as Lessn.

tdy.co/1 points to this site :)

The tdy.co main page is a little plain. However, it is a significant example because it is my first HTML5 page. I’ve never really got into using HTML5 in my current projects because of my unfamiliarity with it, so I’m more than elated that it worked out just fine on tdy.co.

Be Sociable, Share!

Burn after reading » Now you're done reading. What's next?


Related posts that might interest you:


Posts that are popular among visitors: