News for hackers. Stuff that matters.
Re:Twitter Irony: Blog titles are getting longer by RyanMcGreal on Wednesday November 24, 2010 @07:47AM (#1937176)
If you're using MySQL, you can add the following:

    CHAR_LENGTH(post_title) as characters
AFAIK most SQL servers have some equivalent of a LEN() function.

Edit: Better yet, try something like this:

    SELECT left(post_date, 7) as month,
    ROUND(AVG(CHAR_LENGTH(post_title)), 0) as characters
    FROM `wp_PREFIX_HERE_posts`
    WHERE post_type = "post"
    GROUP BY left(post_date, 7)
    ORDER BY left(post_date, 7)
This will provide you an average post title length by month.

Edit 2: Incidentally, here's a chart of article and blog title lengths for articles and blog entries on a moderately well-read civic affairs website I edit: http://min.us/mvfTrxx

There are no comments on this comment yet.