More FriendFeed Stuff

I’ve implemented posting in my Cocoa FriendFeed class, and I ended up rewriting the fetch methods to use a NSURLConnection rather than PubSub. I’m now using a temporary PSFeed object to parse the received data rather than maintaining PSFeed objects for all requested feeds. I could probably use a NSXMLDocument, but PSFeed seems cleaner.

Here’s how I’m doing it now:


// this method handles data received from the NSURLConnection
- (void) parse: (NSData*) data {
    PSFeed *feed = [[PSFeed alloc] initWithData: data URL: _url];
    for (PSEntry *entry in [feed entries]) {
        [_entries addObject: [[FFItem itemWithEntry: entry] retain]];
    }
    [feed release];
}

As you can see I’m using Objective C 2.0, so this will only work in Leopard or later.

FriendFeed API

I’ve been playing with the FriendFeed API in Objective C, although I don’t have anything ready for public consumption yet.

Since the fetch methods basically work like RSS feeds, they can be handled easily using PubSub. Most of the code I had to write was to decode the entries returned into something more useful. The methods which require authentication turned out to be no big deal; it can be handled using PSFeed’s login property and the setPassword: method. My next step will be to tackle the publish methods, which can be handled using NSURLConnection.

To make time to work on this, I haven’t been reading my RSS feeds regularly (or checking Twitter). Setting NetNewsWire to manual refresh only is a huge productivity booster. I also haven’t been blogging regularly, as my readers probably noticed.

HDR Image of the day

I haven’t done one of these for a while, but the dark clouds inspired me to make an HDR image.

Storm Clouds

I spent most of the weekend (when I wasn’t working around the house & garden) writing some Cocoa code for FriendFeed. So far I only support the features that don’t require authentication.

$2500

Jason Snell points out that every Mac he bought cost around $2500, which is also the case for most of my Macs.

In 1984, I bought my first Mac 128 for about $2500. Next, I bought a Mac Plus, also for $2500. A few years later I bought a Mac SE/30, for guess how much – $2500. I replaced it with a (used) IIsi, which I also bought for $2500. I bought my first PowerMac, a 6100/60, as soon as it was available, again for $2500. The last Mac I bought for $2500 was a Duo 270c.

In every case I spent the same amount but got a much more powerful system. After the Duo, I spent less and got much more powerful systems including a Blue & White G3/350, two iBooks (clamshell and the first white iBook), a G4/500 minitower, and several PowerBooks & MacBook Pros.