Getting the WordPress Lifestream plugin to work on my blog

Posted: - Modified: | geek, wordpress

I’ve been thinking about including a digest of Twitter, Delicious bookmarks, Google Reader shared items, and other social activity in my weekly review. This lets me include the information in my archive, and it gives people more opportunities to bump into things I found interesting.

It took a bit of hacking, but I eventually got the Lifestream plugin for WordPress to work, with the help of another webpage and some source code diving. Here’s the code that powers this lifestream page:

<?php $options = array('limit' => 50); $events = $lifestream->get_events($options); foreach ($events as $event) { echo '<li>'; $label_inst = $event->get_label_instance($options); if ($event->feed->options['icon_url']) { echo '<img src="' . $event->feed->options['icon_url'] . '" alt="(' . $event->feed->options['feed_label'] . ') \ "> '; } echo '<a href="' . $event->data[0]['link'] . '">' . $event->data[0]['title'] . '</a> (' . date('D, M j, Y', $event->data[0]['date']) . ')'; echo '</li>'; } ?>

$event->render had been giving me problems, so I specified my own output format. It didn’t automatically pick up icon URLs, so I specified the URLs myself. (Bug: the settings get lost if you re-configure the feed.) The plugin seems to be broken out of the box, but there are enough pieces in there for a geek to make things work.

Because I don't want to use up two of my one-post-a-day slots on weekly reviews, I'm leaving it as a web page that I can review and manually copy into my weekly review post instead of automatically publishing something.

You can see it in action in last week’s review.

Work in progress. Hope this helps!

You can view 5 comments or e-mail me at sacha@sachachua.com.

5 comments

That's great news! We can now get to read more posts from you in a week! :D

@sachac I've been using the Lifestream plugin for some time, and it's been running fine.

I just took a look at it right now, and noticed some extraneous information (numbers off to the side, and error messages from trying to pull from Tumblr) that weren't there before.

I delayed upgrading from Wordpress 2.x to Wordpress 3.0, and only did so last week, so maybe that change introduced some issues. I'll have to figure this out when I've got some more time.

Glad you made it work. I had to roll my own lifestream using Yahoo! Pipes and Javascript. (Admittedly, my content is not as rich as yours. ;))

Thomas Chai

2010-12-07T14:54:01Z

Hi,

Any idea why twitter feeds dun work lately on the ligestream plugin. Could it be the new OAUTH

Nikhil Gupta

2010-12-13T04:18:46Z

Hey Thomas,

Yeah, the reason why twitter will not work is the new OAUTH implementation (new?)
Lifestream plugin still utilizes the discontinued Basic Auth.