Smart Archives v1.01

March 21, 2005

I've just released v1.01 of my Smart Archives WordPress plugin. I strongly encourage anyone who currently uses the plugin to download this release as it takes care of nearly all of the issues that users have written to me about. The list below outlines the changes.

  • Posts with a future date are no longer included in the list(s).
  • Months that contain only posts deemed "private" or "draft" are no longer included in the list(s).
  • Months during which a WP "Page" is created, but which contain no posts for that month, are no longer included in the list(s).

Aggregated beauty

March 19, 2005

50 people see... a beachAs soon as I saw the 50 people see... photoset on Flickr, I was immediately reminded of Jason Salavon's similar work, which I came across a couple of years ago (and from which the programmer here found inspiration).

I'm completely fascinated by the fact that the almagamation of so many disparate pictures, with nothing in common save their subject, can produce something so (in my opinion) beautiful. If I have time I might try to hack the source used to create the photoset so that it blends together every picture I've ever taken — I'd be real interested to see the ?ber-pics produced by different people's collections.

We grow software

March 17, 2005

If you haven't yet read DrunkenBlog's interview with Brent and Sheila Simmons (of NetNewsWire fame), you're really missing out. It's an interesting peek into the world of an independent (and successful) software developer. My favorite excerpt from the interview is when Brent is explaining how working together with Sheila at home every day isn't so bad.

It's a little bit like farm life — but modern, urban, digital farm life. We grow software.

Using FeedBurner to gauge reader circulation

March 14, 2005

I've been playing around with FeedBurner for quite some time and just recently started redirecting my main content feed to my "burned" feed so that I could get a better handle on my [RSS] reader circulation (which, incidentally, FeedBurner handles wonderfully).

Circulation: An approximate measure of the number of individuals for whom your feed has been requested in the last 24 hours. Circulation is inferred from an analysis of the many different feed readers and aggregators that retrieve this feed daily. Circulation is not computed for browsers and bots that access your feed. Circulation is calculated by matching IP address and news reader combinations, and then using our detailed understanding of the multitude of readers and aggregators and bots on the market to make additional inferences.

You can obviously deduce this statistic yourself if you have access to the raw http server logs, but, uhh, why? Can you imagine trying to keep up with all of the new online aggregators out there?

If you've been thinking about moving to FeedBurner, but have some reservations, I'd be interested to hear what they might be as I can no longer come up with any. After all, you can transparently redirect your subscribers to FeedBurner — they'll never see the change (unless of course they access your feed in a regular web browser and pay attention to the redirected URI). What is more is that FeedBurner now allows you to specify the original source URI of your feed (in my case, /syndicate) which it will then use in any external presentation of your feed (e.g., on the sign-up chicklets that users see when they stumble across your feed through a web browser and are shown the XSLT-styled, human-readable XML file).

You never have to inform your old, already-subscribed readers (or your new readers) of your FeedBurner feed, yet you still get to take advantage of all of their wonderful services — win-win.

On a related note, sometime in the next couple of weeks I think I'll probably do a small write-up on the percentage breakdown of the different aggregators that are used to access this site as I think it's quite telling of where this space is headed (hint: it's away from the local client).

I'm still debating whether to use FeedBurner to splice my del.icio.us links into the main content feed (as I mentioned in Outsourcing This Website), but that decision will have to wait for another day.

Just another nail in the iPod's coffin

March 03, 2005

There's really no denying that the future of mobile music is streaming. Just today, a very excited Russell wrote up a piece on the Virgin Mobile radio client, which allows you to stream [random] music to a 3G-capable phone. I, however, am more excited about things like accessTunes, which allow you to stream your music collection over the web. I swear, if someone offered something similar, but with the following additional features, I'd pay handsomely for their product:

  • A web interface that is accessible to mobile browsers (e.g., Opera for mobile)
  • The option to encode my MP3s at a lower bit-rate, on-the-fly, before streaming them (99.9% of my collection is 192+kbps, which current mobile data networks cannot sustain)

Windows smartphone as a bluetooth modem under OS X?

March 01, 2005

I'm going absolutely mad trying to get my i-mate SP3i to function as a Bluetooth modem under Mac OS X. I've obviously set this up many times before for a lot of different devices, but I can't seem to get it to work on a Windows Mobile-based smartphone. Some might say that I'm a glutton for punishment in trying to make this happen, and, well, I can't very well refute that.

If anyone out there has this working with any Windows Mobile device, please let me in on the secret — I've reached the end of the Internet trying to find a solution and am done hacking on it for a while.

SMS and me

February 28, 2005

The Short Message Service has become an indispensable part of my life these last few years. A brief sample of how I currently use SMS:

  • Tell someone I've just left/arrived
  • Remind myself of something from my Trumba calendar (it will send you SMS alerts for your calendar events; I hope the Google calendar speculation turns out to be true sometime soon)
  • Get phone numbers and addresses from Google SMS (this is especially useful when your phone automagically makes phone numbers "clickable" so that you can simply click on them within the SMS to make the call); Google SMS is capable of a lot of neat things
  • E-mail iCal reminders to number@cingularme.com, which arrive on my mobile phone as SMSs
  • Driving directions from either Yahoo! Maps or MapQuest (Google Maps will certainly allow this in the future; you can actually ask for directions through Google SMS, but it's a little cumbersome)
  • If I've just sold something on eBay, I'll use an IM client (or Internet-to-SMS gateway) to send myself the buyer's address so that I'll have it at the post office
  • Have SMSs treated like IMs through my phone which is connected to my notebook over Bluetooth (when SMSs come in they're shown on my computer screen and I can reply to them on the computer just like a regular IM; the computer sends my replies to the phone over Bluetooth and from there they're sent over-the-air to the recipient's mobile phone)
  • Have airlines let me know if my (or a friend's) flight is on time/delayed or if there has been a gate change
  • Have mobile phone manufacturers send me settings for a particular phone/service combination (this is usually faster than finding the needed settings on the net and entering them manually)
  • Have my online brokerage service send me alerts when my stocks have gone below or [hopefully] above thresholds I've set
  • Have the mechanic notify me as soon as my car is ready

Limit number of posts with WordPress

February 26, 2005

One of the first things I noticed when I started to setup WordPress was that there was no way to control the number of posts displayed on the index page from the admin panel. Yes, there is the "Show at most" option, but this is a site-wide variable and works to treat all of your pages the same — I didn't want that.

So, as things sometimes go on this site, I didn't plan to post a workaround to this (it's kind of trivial), but I've had a few people ask me how to do it and so I thought I'd explain it here both for them and for future Google traffic.

Why I Wanted This

All of this stems from the fact that I don't usually like "next 10 posts" / "previous 10 posts" links and didn't want them on my website. Rather, I like whatever archives page the user is on (be it yearly, monthly, or daily) to display all of the posts for that particular time span. This can be achieved rather easily by setting the "Show at most" option to something very large (i.e., a number at least as large as the number of posts on your "largest" page). The problem is that this number will also be used to control the number of posts on your index page.

The Fix

To limit the number of posts on your index page while allowing all other pages to look to the "Show at most" setting, you simply need the following lines of code.

<?php static $ctr = 0; 
if ($ctr == "X") { break; } 
else { ?>

You'll want to place this code directly inside the main loop you use to display the posts on your index page. The regular PHP and/or HTML that actually forms these posts should be placed inside the open "else" shown in the above code. You should then close the "else" with a curly bracket ("}"). Change the "X" in my example to the number of entries you want displayed.

Because you need to increase the "ctr" variable by one each iteration through the loop, you'll need to put the following code right before the loop is terminated.

<?php $ctr++; } ?>

It's that simple. After this code is up and running, your index page will display the first X entries and your archive pages will display the number of posts as defined by "Show at most."

Mobile jellyfish

February 24, 2005

mobile jellyfishThis is a screenshot from my latest phone, the i-mate SP3i. I'm putting it up here because I've had a few friends express some interest in using the jellyfish picture as their background after seeing it on my last couple of phones. You have to admit, it does look pretty damn good as a mobile phone wallpaper. I use the same picture for my desktop background as well; it's probably my favorite photo from the entire Monterey, Carmel, and Big Sur set.

Feel free to download the original (2048x1536) picture and do with it what you like.

i-mate SP3i

February 22, 2005

I've received quite a few e-mails asking when I plan to put up a review of the i-mate SP3i. I really can't say. I'm incredibly busy at the moment and so I'm really not sure if I'll get around to doing a full review; if I do decide to do one it won't be for a while. I certainly don't mind answering questions though if there is something specific you want to know.

I will say this: if you know you want a Windows Mobile smartphone and have your eye on the SP3i, buy it. I don't have anything negative to say about the phone itself — it's awesome (though I do have some issues with Windows Mobile; surprising, I know).

Quickly, a few things I really like about the phone:

  • Best mobile speaker I've ever used (very, very loud); this includes regular use, speakerphone, and gaming
  • Best T9 implementation I've ever used
  • Best Arkanoid-type game I've ever seen, on any platform (it ships with a package of 9 games and all of them are excellent)
  • Very solid construction
  • Perfect form-factor and weight
  • Great battery life
  • Brilliant screen (just about everyone I've shown the phone to has commented on it)

TextWrangler

February 20, 2005

TextWranglerTextWrangler is the best free GUI text editor I've ever used and certainly worthy of being the progeny of the almighty BBEdit. I can't say that there's anything I haven't been able to accomplish with it, either through native features or some AppleScript voodoo. I use it for everything — the code that runs this site, the posts you see on this site, law school, side projects, personal notes, Mac OS X config files, etc — I currently have 17 open documents in my TextWrangler drawer. It's great.

Maintaining URIs between Movable Type and WordPress

February 16, 2005

When I moved to WordPress I made the decision to change the layout of my archived URIs. To be honest, I was going to make this move under Movable Type as well, but just hadn't got around to it. This modification amounts to nothing more than changing a uri_that_looks_like_this/ to a uri-that-looks-like-this (dashes and no trailing slash). The reasons for this aren't worth going into right now, but if you're interested, feel free to e-mail me.

If you initially followed my steps for future-proofing your site in Movable Type and are moving to WordPress and want to keep a similar archive structure, then follow the steps below. Even if you didn't use my future-proofing method for MT, but are still thinking about moving to WordPress, you can probably figure out what changes would be needed to the following code to make it work for your particular setup (assuming the archive structure you used under both CMSs is based, at least in part, on the titles of the posts).

Step One

The first thing you are going to want to do is to create a new MT template which contains the following code (perhaps modified for your particular situation).

<MTEntries lastn="10000">
RewriteCond %{REQUEST_URI} <$MTArchiveDate
format="%Y/%m/%d"$>/<$MTEntryTitle dirify="1"$>/$
RewriteRule .* archives/<$MTArchiveDate
format="%Y/%m/%d"$>/<$MTEntryTitle dirifyplus="pld"$> [R,L]
</MTEntries>

Realize that the rewrite lines above should each be one long line (i.e., no line breaks).

The above code will traverse all of your Movable Type entries and create the appropriate conditions and rules for each of them, the idea being that each individual entry will get a separate RewriteRule that will direct it to the new [slightly altered] URI.

Step Two

Build this template.

Step Three

Copy the contents of the resultant file into your root .htaccess file or the one in the root of your archives directory — shouldn't really matter. Either way, be sure to include these rules before the htaccess rules that WordPress creates (and needs to work), else the server will act on those earlier rules and never get to these.

That's it — now all of your old MT archives should forward to the new URIs.

Beware

I noticed that Movable Type's "dirify" function and the "dirifyplus" plugin remove dashes within a title and so if you used either of these to make your directory structure (which this little guide assumes), you'll need to go through your entries, find those that have a dash in the title, and then reinsert that dash in the RewriteRule portion of that particular address (else, the link will be unreachable).

I've moved to WordPress

February 14, 2005

After spending more time hacking up the source than I had ever anticipated, this entire site (both public and private) has been completely moved over to WordPress (from Movable Type). Those of you out there who have made such a transition realize what a large undertaking it can be and my case was certainly no exception; starting out with WordPress and using a default template is one thing, but transparently moving over a complicated, customized, content-heavy weblog is an entirely different matter altogether.

Like everyone else it seems, I've been rather impressed with WordPress and can't wait to delve deeper into it and contribute to the community that has sprung up around it. I put a lot of time and effort into writing tutorials, HOW-TOs, and general tips and tricks for Movable Type and plan do the same for WordPress as soon as I get efficient with it (on a related note, I think I'm going to compile my Movable Type 'how-to' entries and present them in a single post here for those who are just getting started with that system).

The Transition

The goal was to keep everything looking and working exactly the same as before, and for the most part, I accomplished that. After familiarizing myself with the basic layout and structure of the CMS, I looked at the source of various themes to further wrap my head around this monster.

After getting the initial site-wide template up and running I spent a fair amount of time hacking htaccess files. I was kicking and screaming there for a while — fixing one thing was breaking something else and on more than a few occasions I thought I had fixed everything only to find something not working quite right as I started to dig around. Sometime in the next few days I'll put up a post outlining my mod_rewrite solution. That said, everything should be good to go now (and all old URIs should seamlessly redirect), but if you notice any problems, please let me know.

All that's really left to do is to modularize with PHP includes; I think I had twice as many template modules in my Movable Type installation than I had actual templates (I like to simplify and condense!).

Movable Type total word count

February 11, 2005

Every so often curiosity gets the better of me and I want to find out (and publish) the total number of words I've put into the posts on this site (you can now see this at the top of my main archives page). Unfortunately, and quite surprisingly, each time I've looked for this functionality I've come up empty (and yes, I'm aware of MTWordStats, but it's broken, at least for me); Movable Type still doesn't count the words of individual entries for you, much less give you a function that returns a weblog-wide total.

I came up with a quick and very simple solution.

The first thing you'll need to do is download and install the WordCount plugin, which returns the number of words in a given post. To get the total number of words throughout your weblog, you'll need to run this plugin over all of your entries. To do that, insert the following code at the top of the template you're going to use to display the total.

<MTEntries lastn="10000">
<?php $tWords = $tWords + "<$MTWordCount$>"; ?>
</MTEntries>

To display this total, place the following code in the template where you want the number shown (make sure that this code appears somewhere below the above code).

<?php echo number_format($tWords) ?>

Yep, that's it.

We're getting there

February 09, 2005

I love being able to take out my mobile phone, fire up a browser, log into my TiVo account, tell it to record a show for me that I've just been made aware of, and then receive, on my phone, a confirmation e-mail within the hour from TiVo (after it's talked to my machine at home) to let me know that the show will or will not be recorded.

Instrasite searching with Google

February 08, 2005

I doubt many of you have noticed (especially the regular readers of this site), but I reworked the search section about a month ago so that it now uses Google for intrasite searches. I never mentioned it here because I didn't really see the point, but I've had a couple people ask me how to do it and so I thought I'd explain it a bit here.

The reason I handed over searching to Google in the first place was because of the way Movable Type returns search results; not only does it refuse to remove the trailing filename but it also likes to place anchor tags at the end of it. Technically, there is nothing wrong with this as it still gets people to the page they were looking for, but it just "looks" ugly and people end up linking to me with malformed URIs. This never really bothered me until I implemented future-proofed URIs here (and wrote up a HOW-TO on how to set this up in Movable Type). My URIs are "clean" and I wanted my search results to follow suit. Yes, I could have just hacked up the MT code but this way was much quicker and also allows us to search using a syntax we're quite familiar with.

Setting Up Your Site

This certainly isn't rocket science and anyone with a rudimentary understanding of HTML forms and the Google syntax could figure it out, but for those among us who are a little less motivated, I've put my form below.

<form method="get" action="http://www.google.com/search">
<input type="text" name="q" maxlength="255" class="search"name="search">
<input type="hidden" name="sitesearch" value="http://justinblanton.com">
<input type="hidden" name="q" value="-intitle:archives">
<input type="hidden" name="q" value="-intitle:referrers">
<input type="hidden" name="q" value="-intitle:links">
<input type="submit" name="sa" VALUE="Search">
</form>

I'm going to assume that most of this is pretty self-explanatory, but for the sake of completeness, I'll elaborate some. The "sitesearch" input element tells Google to search only within the given site. You'll notice that I go a bit further and include a few "intitle" restrictions; if I didn't do this, the user would get the same document multiple times (because of the index page and monthly/individual archives). I recommend playing around with the search on your site to decide what input tags you will or won't need — this will obviously vary greatly from site to site and will be based in large part on your site's structure.

This method isn't exactly perfect and there will be certain circumstances where the results, without further tweaking, are completely useless. For example, if you search for "gadgets" on this site, you will see that Google returns nearly every page under my domain. This is because I have the word "gadgets" in the menu on the right. There isn't much that can be done about this except maybe narrowing your search. Perhaps in the future Google will allow you to restrict searches to divs within a document's markup.   *shrug*

When time permits, I think I'm going to use the Google API to do intrasite searches so that I can style the results to look like the rest of my site (i.e., the user won't realize that the search was done off-site).

Where to put my BlogAid money?

February 03, 2005

Please e-mail me with any suggestions you might have about where I should donate the money I generated for the BlogAid project. I have a couple of places in mind, but any feedback would be great, especially if you have first-hand knowledge of the organization and their work. Thanks.

Let this post also serve as a reminder to all of those who agreed to participate in the effort that our contribution is due.