As I’ve mentioned, I’m enjoying Twitter a lot. The only problem is that it rarely works for me as it should — I’ve only had text updates to my phone for a day or two over the past couple of weeks, and I can no longer get updates via IM either.
While I still text stuff to Twitter when I’m out, it feels a bit like shouting into a void, unable to hear everyone else. I could use the web on my Treo to view updates but I found it all a bit clunky, getting a whole 24 hours of posts every time I wanted to see what was new. It’s a small problem, but enough to give me an excuse to have a bit of a play.
I used the API to create an extremely minimal page, with no graphics, that just displays the most recent twitters by my friends; all the posts since I last viewed the page. Beautifully simple and very satisfying. Here’s a static example.
If you’d like something similar, you can download this file, give it a .php file extension, put your email address and password in the correct places, and upload to your server.
(A word of caution though: put it somewhere private, preferably password-protected. Some of your friends might only be sharing posts with friends, and won’t want you broadcasting it to all and sundry, which is why I’m not showing you my actual page.)
Update: On the off-chance you downloaded this earlier, I’ve made a few tweaks to the code. It’s now on v1.3.1, so you may want to update if you have a previous version.
Update 2: I’ve just updated the file to the most recent version (v1.4) which includes a form for posting your status updates, although I seem to remember the code getting a bit messy. Posting can be a little flaky and I’ve now started using the new, official mobile interface which is more reliable than this script. (7 July 2007)
Comments
Commenting is disabled on posts once they’re 30 days old.
Ickmund at 3 Dec 2006, 2:21pm. Permalink
Hmm, this looks interesting. Been tinkering with a javascript to simulate a feed from a group of people. It's a shame there's only one group on Twitter, friends.
Anyways, the javascript needs to call Twitter for each member to be possibly displayed (only showing the X latest in the feed) and I reckon it'll get too slow too quickly with a growing number in the group.
Assuming everyone in the group is also in my list of friends this script saves me alot of time of having to write it myself, so thanks a bunch!
Ickmund at 3 Dec 2006, 3:08pm. Permalink
Actually had some problems with the dates, strtotime wouldn't take Twitters format. Ended up exploding it and putting it back together in a usuable format.
Other then that it's a lovely script!
Phil Gyford at 3 Dec 2006, 3:29pm. Permalink
It's strange about strtotime() Ickmund -- I use it in the script to parse the Twitter dates and it seems to work for me.
Nico Macdonald at 6 Dec 2006, 12:35pm. Permalink
To reduce the cost of using Twitter on your Treo you could use the Verichat IM client for Palm, which supports the AIM protocol now supported by Flickr. I am currently experimenting with this. Doesn't allow you to see Twitter updates however.
Phil Gyford at 7 Dec 2006, 4:01pm. Permalink
Good idea, thanks Nico. It looks like PDAApps is no longer selling Verichat, although it's still available on some other sites. SMSing my Twitters works fine for me at the moment, even if I can't see other people's, but I'll bear it in mind in the future.
Colby Palmer at 7 Jul 2007, 5:19pm. Permalink
Fantastic script Phil! I'm having problems with strtotime() as well though - even saving the twitter.txt file as a PHP doc and uploading it with no changes, it returns "31 Jan 1969" for every single post. If I take the _relativeTime function off of $this->created_at it displays the correct times for each post - for some reason the function makes the dates the same for each post as well. Can you offer any insight?
Phil Gyford at 7 Jul 2007, 5:55pm. Permalink
Colby, I'm not sure what's causing that I'm afraid. I've just posted v1.4, which seems to be working for me, so maybe give that a whirl and see if it's any better.