About that capitalization thing…

A few people have commented on how Tweeterboard handles capitals. Just the other day nateritter said “fix your capitalization problems. They’re the same people, sheesh.” And then a few hours ago, yndyngo said “you show up twice on my Tweeterboard stats – once as “maxweb” and once as “MaxWeb” – gotta love case sensative apps.”

A case-sensitive app? I like to think I’m smarter than that, but I had to hunt through the database and code to understand what was happening. The good news is that Tweeterboard doesn’t treat “MaxWeb” and “maxweb” as different users. However, it does store that user name in a couple of different places. In the users table, it’s “MaxWeb” which is how it’s spelled on Twitter. In the table that records conversations between users it’s “maxweb” because the function that extracts user names from tweets converts everything to lowercase.

On yndygo’s profile, you see “MaxWeb” under the “Gets Love” tab because that name is pulled from the users table. Under the “Gives Love” it pulls the name from the conversations table so it’s “maxweb.” If Tweeterboard were truly case sensitive, “MaxWeb” and “maxweb” would be treated as separate user names and would appear in both places. But they don’t–a fact I confirmed with a bunch of manual database inspection so, while I wouldn’t bet my life on it, I’m pretty sure that’s the case. Like 99%.

In the next day or so I’m going to tidy things up so all user names appear in lowercase. (I’ll leave it up for now so you can see the differences I point out above.)

Advertisement

  1. So glad to hear that’s going to be resolved! My Box Score page was getting a wee bit too jumbled. Thanks. :)

  2. John Tyler

    Seems like your database schema is flawed. You should never duplicate information in a database.

    Instead, your “conversations” table should include a pointer (such as the user id) to the MaxWeb user instead of his username.

  3. tweeterboard

    Seems like your database schema is flawed.

    I knew someone was going to say that!

    First of all, you’re probably right that the database isn’t as optimized as it could be.

    But the reason the conversations table contains twitter user names is so that it can capture your @ messages to other users even if Tweeterboard doesn’t track them (i.e. even if they don’t have a corresponding id in the users table). This seemed like a necessary compromise between functionality and normalization.

  4. MySQL function LOWER(). :)

    Presuming you’re using MySQL, but just about any DB should have a similar function.




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s



Follow

Get every new post delivered to your Inbox.