Highlighting some tweets on my blog - experiments with Feeds

In an attempt to revitalize my blog, I recently switched themes, this time to the cool Magazeen theme and decided to highlight some fresh and inspiring content by cherry-picking tweets. Inspired by Dan Cederholm's Simplebits, where "tweets" were mixed with blog posts way before twitter was started, I decided to aggregate some of my tweets on my site. Let's see how I've done it.

Well, it sounds easy, right, since Twitter has this feed of tweets for each user, so I could just grab my feed and display items from there? First of all, I needed to be able to highlight them among blog posts. I'm still undecided on allowing comments or not (not that I expect floods of comments, but picking tweets out of their home medium and allowing comments here might not be conceptually right). But them being nodes allows me to list them with the blog posts and to include them in the site feed. While this might get duplicate content for people who both follow my blog and twitter feed, I decided to highlight some items for their usefulness, and having them as nodes ensures that they can be on for longer, sticking them out of the quick waterfall of twitter.

So to create nodes of feed items, I picked the coolest kid on the block, Feeds module. It creates tweet nodes for me dutifully (see the project page for setup instructions and video links). For those nodes to be unpublished by default, I learned (via twitter), that the default node type settings are adhered to. This still does not allow me to provide a default author and default input format (see below), but it is an experiment so far, so it will get better.

Tweets have certain special items like @username references and #hashtags. These should be linked to their respective twitter.com pages, and twitter module has input filters for these which I could use to build up an input format. (Given my use case, I had no use for the rest of the twitter module, so I took the format code into my site-specific module, and do not actually use twitter.module.) The twitter feed also includes my username at the beginning, which my site readers will either know or do not care about, so I also wrote a quick filter which will transform my username to a "from twitter" link at the end of the node body.

Finally, some custom theming needed to be done for tweet nodes. Hiding the node title and author seemed appropriate, as well as some font size adjustments, so tweets stand out a bit.

I'll surely keep refining this, and if nothing else, the cherry-picking process gives me reasons to come back to my blog more often, so it might inspire me to write more, which could be useful on its own.

For format assignment, it might be possible to use a module which sets default input formats per node types, and if feedapi just picks that up, then we can generalize this functionality (instead of building it into feeds). Per-content type input formats are a popular topic anyway.

Thanks for this helpful post. I'm looking to do essentially the very same thing you've described here. I have just a few questions and would be really grateful for any help you may be able to offer.

Do you suppose this same solution could be used on a Drupal 7 site running Feeds?

To a non-developer and one who is an intermediate Drupal site builder at best, how would i actually go about applying the filters from the Twitter module as well as the one you've listed above? I really have no idea where i would implement the code (and by implement i mean carefully copy and paste after very specific instructions)... (o:

Lastly, am i correct in thinking this is the actual code you're referring to?