Archive for the ‘opinion’ Category

Coding a WordPress blog for Twitter integration

Tuesday, June 2nd, 2009

Twitter is often likened to the evolution of blogging and compared to it in a competitive sense, but I think that isn’t really a fair comparison. Twitter is definitely a streamlined version of blogging, but to accomplish that Twitter had to strip out many integral features of blog software. In my opinion one of the best implementations of both blogging and Twitter is to combine them.

techognized-twittercap

Last year I coded techognized (above) to integrate twitter posts and traditional longer form blog posts on the same page, and more recently, Boing Boing Gadgets (below top) has just redesigned their site to display tweet-like mini posts in the same column as normal posts. In hindsight, I like BBG’s approach better, so with simpler.me (below bottom) – my latest site design – I coded twitter inline with other blog posts.

gadgets.boingboing.net

simpler.me

Here is how to do that.

It’s actually pretty simple, if you know the basics of editing WordPress theme files. Before breaking out your text editor of choice to code, here are a few steps to lay the groundwork:

  1. Create a WordPress category (I named mine “Twitter”) and note the category ID number.
  2. Install the Twitter Tools plugin and configure it to create blog posts from your tweets, filed in the category you created in step 1.

Now to the coding. Our objective here is to remove the blog post’s title based on if the post is a tweet or not. To do this we will use a simple PHP ‘if’ function in the site’s index.php file:

<?php if (!in_category(‘[Twitter category ID number]‘)) { ?>
[Information your are cutting out in Twitter posts goes here -- title/header, etc.]
<?php } ?>

Basically, we are saying “If a post is NOT in the Twitter category, show the header/title/etc information”. Here is how that would look in the default WordPress Kubrik theme’s Loop:

<?php if (have_posts()) : ?>

<?php while (have_posts()) : the_post(); ?>

<div <?php post_class() ?> id=”post-<?php the_ID(); ?>”>

<?php if (!in_category(‘[Twitter category ID number]‘)) { ?>
<h2><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></a></h2>
<?php } ?>

<small><?php the_time(‘F jS, Y’) ?> <!– by <?php the_author() ?> –></small>

<div class=”entry”>
<?php the_content(‘Read the rest of this entry &raquo;’); ?>
</div>

<p class=”postmetadata”><?php the_tags(‘Tags: ‘, ‘, ‘, ‘<br />’); ?> Posted in <?php the_category(‘, ‘) ?> | <?php edit_post_link(‘Edit’, ”, ‘ | ‘); ?>  <?php comments_popup_link(‘No Comments &#187;’, ’1 Comment &#187;’, ‘% Comments &#187;’); ?></p>
</div>

<?php endwhile; ?>

<div class=”navigation”>
<div class=”alignleft”><?php next_posts_link(‘&laquo; Older Entries’) ?></div>
<div class=”alignright”><?php previous_posts_link(‘Newer Entries &raquo;’) ?></div>
</div>

<?php else : ?>

<h2 class=”center”>Not Found</h2>
<p class=”center”>Sorry, but you are looking for something that isn’t here.</p>
<?php get_search_form(); ?>

<?php endif; ?>

Your blog now should display posts from twitter without the title/headline, while leaving your other posts untouched. You can use this same method to edit out the author and timestamp if you wish. Remember, you may have to touch up your CSS afterward in case removing the header fouled up your margins or spacing.

Hope this post has been useful!

The Amazon Kindle 2: A half step forward, a quarter step back

Monday, February 9th, 2009

kindlev1v2

Though it has been rumored for months, Amazon just “officially” announced their successor to the first Kindle. I own one of the first generation models, and I think I will pass on upgrading to the new one. There simply isn’t enough of an upgrade to justify the cost, and furthermore, a few positive features of the first model have been dropped entirely.

First, here’s what they did right:

- More detailed, faster screen. It still isn’t the high-contrast, color screen that would be ideal, but it is moving in the right direction.
- USB charging. Finally!
- Text-to-speech. The ability to read books aloud is obviously a huge boon for the visually impaired, but is even an advantage for people who would just like to have a book or an article read to them (such as while they are driving).

And what is worse:

- No “mirror cursor”. The little instant-feedback cursor on the right of the original Kindle’s screen was great. I worry that the Kindle 2′s direct joystick screen selection will be sluggish.
- No SD Card slot. Yes, it does include more out-of-the-box memory (2GB), but you can’t add any more like you could with the first Kindle.
- No user replaceable battery (?– unconfirmed). Another mixed blessing – the battery in the Kindle 2 is bigger and longer-lasting, but if it dies, you can’t easily replace it.
- No rubber backing. This has definitely kept my Kindle securely planted, and I am sad to see this clever feature go.
- No lower price. Perhaps the most important negative, the still-$360 price tag will hinder mass adoption of the device.

Overall, Amazon is doing a great job considering they are still very new to product design, I just wish they weren’t removing great features the first edition had!

What Apple would be smart to announce tomorrow: iPod Touch Bluetooth

Monday, September 8th, 2008


Almost exactly a year ago to this day, rumors were spreading that the then-upcoming Apple iPod Touch would include Bluetooth. Such rumors were quickly debunked, but in doing so, blogger Joel Johnson even speculated about how the feature may have given VoIP applications a boost.

Tomorrow is an Apple Event, and the company is expected to launch a redesigned iPod Nano and possibly new iTunes software as well. What would really be the smart (and probably pretty easy) thing to do would be to add Bluetooth to the iPod Touch. It would give the Touch a new relevance in an iPhone dominated market, by opening up the device to VoIP applications.

It would also benefit consumers by giving them a more ubiquitious home Wi-Fi VoIP device than the current sporadic offerings, and obviously benefit Apple through greater iPod Touch sales. The only group not thrilled by a Bluetooth-equipped iPod Touch would be the phone and cable companies, who love bundling in overpriced VoIP services with their internet and/or TV offerings.

Unintended Consequences? Steve Jobs and AAC DRM

Monday, September 10th, 2007

Ipod1G_DRM

Either Steve Jobs is sneakier than most people realize, or he is unintentionally accomplishing his DRM-free music goal.

This month, Amazon.com is set to launch their own DRM-free music store and Walmart has already launched their own sans-DRM music store. This is great, however I doubt the executives at Amazon and Wal-Mart (and more importantly, the music labels) had any sort of digital-epiphany though. Think about it: according to Bloomberg, the iPod had a 72% market share earlier this year, and all of those millions of iPods sold only work with Apple’s own proprietary AAC-based DRM. To sell music in any volume, non-Apple retailers must sell music that can play on any mp3 player, including the all-important 72% market share iPod.

Basically, though Apple’s “iTunes Plus” sales of DRM-free music does matter, by far the bigger contribution Apple/Steve Jobs have made to DRM-free music sales is their refusal to license Apple’s own “Fairplay” AAC DRM.

[Sources (in order linked): Apple.com, NYPost.com, Gizmodo.com]