Playing Here

Playing Here is a website I made based on the MySpace Events Feed Creator. It uses the same process to index MySpace pages for events, but instead of creating feeds by band, it creates feeds by state, city, and venue. It also has a microformatted web interface, email subscriptions, and JavaScript includes for the events. E.g.:

Sortable Tables with Totals and Averages

If you’re publishing any sort of complex statistics, it’s often helpful to be able to sort this data. If the data is coming from a database, you can often do this sorting on the server side rather easily, but sorting on the browser side in JavaScript is generally a better user experience. Contrary to what the “table vs. CSS” rhetoric implies, tabular data still belongs in tables (though layout does not). And HTML tables offer a standard formatting for sortable data, allowing us to apply the same JavaScript behaviors to a wide variety to data.

Enter sorttable, a JavaScript from Stuart Langridge. Sorttable automatically adds sorting behavior to any table explicitly classified as sortable, with the simple semantic HTML: class="sortable". This is a great demonstration of the benefits of separating form from function. Unfortunately, anyone using sorttable with descriptive table markup in HTML will quickly run into a problem: totals and averages get sorted along with everything else.

Let’s say you have a table of people with names, ages, and number of children. Sorttable lets you sort this list by name, age, or number of children. But at the bottom of this table, you have an average age and total children. Sorttable sorts this as well. What to do? One solution is to take advantage of the rarely-used tfoot HTML element. By wrapping totals and averages in a tfoot, our HTML can indicate that this content is distinct from the rest of the table. Problem: solved! Semantic HTML saves the day again.

Well, not exactly. We still need to make sorttable take note of this distinction. To do that, we just need to change this:

for (j=1;j<table.rows.length;j++) { newRows[j-1] = table.rows[j]; }

to this:

for (j=1;j<table.rows.length;j++) {
if ( table.rows[j].parentNode.tagName.toLowerCase() != 'tfoot' )
newRows[j-1] = table.rows[j];
}

This should appear around line 78 in sorttable.js. What this does is exclude any table rows within a tfoot from sorting. Now we can safely apply sorttable to any HTML table we want to sort, even if it has non-sortable information at the bottom.

Update: The original sorttable.js has been updated to include tfoot checking, so there’s no longer any need to edit the script.

Discussion List, Crossdomain.xml for Flash

Many people send questions about this site via private email, which is fine. I’m happy to answer these questions. But often the same question is asked by multiple people working on similar projects. In an effort to connect these people, I set up a Make Data Make Sense discussion list. If you have a question others might have, please sign up.

One of these often-repeated questions is “will you add a crossdomain.xml file for my domain so I can load your feeds in Flash?” And I helpfully say “No, I won’t, because I don’t want to spend my time doing that for every domain that might want to reuse my feeds. Why don’t you just set up a simple proxy script on your own server to bypass the restriction in Flash?” In the most recent exchange on this issue, though, I discovered that I can just set up a generic crossdomain.xml file to allow access from any server. So now that crossdomain.xml file is on the server, and Flash-based feed readers are happy.

Ideally the discussion list will arrive at simple solutions like this faster than I could by answering questions privately. Twenty heads are better than one, right? I hope so.

MySpace Events Feed Creator

What was previously the MySpace Events RSS Creator is now the MySpace Events Feed Creator. As the name change suggests, Atom feeds are now an option. Also, there are now two styles for displaying the event information: “Standard,” or what everything was before, and “Simple,” which removes all redundant information (e.g. MySpace user name is in the feed name, so it doesn’t need to be repeated in every event) as well as the labels. And finally, the MySpace profile pages are now being cached every hour, which should improve the speed all around.

The MySpace Blog and Comment tools will eventually get similar updates. Events was done first because someone graciously paid for these changes. If you have changes you’d like to see to any tools here, the first step to getting them done is to ask for them. The second step, paying for them, is optional.

Comedy Central Feed Creator

The Comedy Central RSS Creator has been updated, and renamed as the Comedy Central Feed Creator. Feeds are now available in both RSS and Atom. Feeds also now point to Comedy Central’s Flash video player rather than the old Windows Media format videos. The new player works much better.

Also, the new feeds include video descriptions (in addition to titles), durations, and download links for the Flash video files in both high- and low-quality versions. If you’re using a podcast viewer that can handle Flash video, you can also subscribe to the feeds as podcasts. Finally, the feed creator is caching now. Rather than checking for new videos every time a feed is requested, it only checks once per hour. As a result, the response time should be much faster, which is good for everyone involved: your feed reader, the Make Data Make Sense server, and Comedy Central’s server.

Please leave a note if you have any problems with the improved version, or anything else you’d like to see.

PHP Source Browser

PHP is a popular open source scripting language, but there’s no convenient way to share the source of a live site. It’s easy to make a publicly viewable copy of PHP scripts, but these copies are inevitably neglected when the live copy is updated. Source Browser is an attempt at solving this problem.

Source Browser should be usable on any PHP server simply by setting the directory that should be open source, and optionally any subdirectories that should be restricted. Point it at your server’s root directory, restrict any confidential files, and you have a live open source website.

By default, only PHP and HTML source files are displayed, but any extensions can be specified. Default PHP syntax highlighting is also replaced by class names, to allow easy reformatting with CSS. Source Browser works as a standalone web application, but it can be easily integrated with any existing site. It’s released under GPL. If you have any questions or suggestions, please leave a comment.

MySpace Events RSS Creator

By request, MySpace Events RSS Creator does exactly what the name suggests, growing (completing?) the family of MySpace RSS creators here on Make Data Make Sense. As an added bonus, the events are marked up in hCalendar format, so they can be easily imported into various calendar applications. Please point out any problems or potential improvements in the comments here.

MySpace Podcasts

Feed2Podcast is a neat service that takes RSS feeds, runs them through a text-to-speech engine, and produces podcasts. This service is now combined with the MySpace RSS Creator here on Make Data Make Sense to produce podcasts of MySpace blogs. Standard data access formats (even RSS) allow for this kind of mixing of services. MySpace should have an API.

A Log, for Words and Data

Welcome to the Make Data Make Sense log! Let’s jump right into talking about making data make sense. We can anticipate creating a lot of data on this log, so how can we ensure it will make sense?

First, with a meaningful name. This is not a “blog” because “blog” doesn’t make sense. What does “blog” mean? Anyone can tell you by now, it’s short for “weblog.” But why were we ever talking about “weblogs” anyway? That’s just redundant. We can see it’s on the web because we’re viewing it in a web browser. Just like there’s no point in appending “www.” to the front of every domain name, there’s no point in calling this a “weblog.” It’s just a log.

Our next step in making this log meaningful is using WordPress. WordPress isn’t perfect, but it’s widely used and open source, so we immediately gain access to a wide variety of plugins to do interesting things with data. We also gain access to themes.

The theme we’re using is based on Sandbox. Sandbox is a visually plain WordPress theme, so it allows for simple restyling, and it also incorporates microformats where appropriate in the markup, which is good for reasons we’ll explore another time.

That should be enough introduction to the log for now. Hopefully it makes sense. And data.