How to do lifestreaming with WordPress


Lifestreaming with WordPress

Lifestreaming is a term commonly used to describe the mashing up of everything you do online. A bit presumptuous, perhaps, to assume that your life is online, but there you go. Usually your lifestream involves links to your weblog posts, status updates on Facebook, tweets on Twitter, photos from Flickr, books you read from LibraryThing, videos from YouTube, and so on. Basically, the more the better, with everything mashed together in a chronological list of sorts.

The mashing together of your online life usually relies on RSS, and so, theoretically, you can use WordPress for lifestreaming. Either you do it by creating your theme in such a way that it uses the built-in SimplePie RSS parser to mash up and then output everything, or you use one of the RSS scraping plugins to feed your WordPress database with the content as posts.

Setting up a Lifestream

Needless to say, it is possible to create a fully functional lifestream using SimplePie functionality, but you would perhaps have a hard time making it load snappily. In my mind there are three possible setups discussed in the following sections for someone who wants to lifestream with WordPress.

The Built-in RSS Way

If you pull in all your content from the various RSS feeds generated by your accounts across the Web, you’ll have a hard time managing the feeds. You can mash them up, and perhaps cache the content in either files (which SimplePie supports), or in the database (which isn’t officially supported but possible), and then serve it in your theme. This is a stiffproject to get working, but it is definitely possible. A slightly less daunting solution relying on the built-in RSS parser is to have a set of boxes containing different kinds of content, grouped by relevance or just on a whim. It may not be the typical chronological list of updates, but it will serve you just fine in most cases.

Use a Lifestreaming Plugin

There are a couple of lifestreaming plugins available, with the most aggressively heralded one being WP-Lifestream (wordpress.org/extend/plugins/lifestream/). It works well enough and lets you set up what sources you want to fetch feeds from, and then you can include the lifestream in your sidebar or on a Page, for example. This is by far the easiest way to get started with lifestreaming using WordPress, but it may not offer you the customizations you crave. Also, there are other issues regarding load times, which I’ll get to in a bit.

The WP-Lifestream plugin saves the fetched content to the database. Not all lifestreaming plugins do that, which I think is somewhat necessary. After all, without saving the content (and hence maintaining an archive of your activities online) there really is no point in not just showing the content as it is of this moment, is there? Make sure your lifestreaming plugin of choice has the features you need, and be extra wary on this one.

Feed the WordPress Database

The third and final solution is to feed the WordPress database with content from RSS feeds using scraping plugins. The idea here is to actually create a WordPress post, preferably sorted into a suitable category and perhaps even tagged (although that will probably be hard), and then display it in your theme using the normal methods. This would theoretically mean that you can have a Flickr category containing everything from Flickr, a Twitter category that saves all your tweets, and so on. The fact that everything is stored as normal posts makes it easy to manage, which is a good thing.

The FeedWordPress (wordpress.org/extend/plugins/feedwordpress/) plugin is one of several scraping plugins that can fetch RSS feeds and save them in your WordPress install. Using a solution like this may seem a little bit extreme, but it is definitely possible, and with some nifty theming you can get a site with weblog and lifestreaming sections and a great database for search and categorization.

About Those Cronjobs

The problem with fetching RSS feeds (and anything that comes from outside the server, really) is that it takes time. PHP needs to ask the target server for the feed, then the server has to send it, and then your server needs to receive it, and PHP has to wrap everything up by doing something with the fetched content. Compare that to querying the database and outputting the data, and you’ll see the problem.

Now imagine you have 10 online identities that you want to include in your lifestream. When a visitor comes to see what you’re up to online, PHP needs to query them all, receive all the content, and then output it. And that’s assuming nothing lags behind, which can cause the script to break (which would be poor programming) or delay until an answer, even if it is a negative one, has been received. Then you’ll understand that a lifestream page can take a lot of time to load.

That’s why you cache content, and any decent solution will have support for caching. However, the fetching and caching has to be initiated by someone. In its purest form it means that even if the content is cached, one poor visitor every 30 minutes (or whatever limit is set) will have to wait for everything to be downloaded, cached, and then output for it to work. You can do this with SimplePie, and most lifestreaming plugins will have some form of caching solution. Both files (text files basically) and database solutions can be used.

There are better solutions. One is the built-in WP-Cron feature that is something of a pseudo-cronjob called by some plugins. Another, preferable one, is a cronjob. This is basically timed instances run by the server independently, which means that no visitor will have to sit and wait for all those RSS feeds to be loaded. The only thing that will be served is the saved (cached) content, and that’s the only thing that is updated as well. How you set up your cronjob depends on your host. Most likely you have a control panel where you can make changes to your site. Look for cronjob settings there. Diehard Linux fans will obviously use the terminal, but that’s pretty far from the scope of this article. For the rest of us, the host’s built-in control panel solutions will do.

If you plan on running a lot of RSS feeds, which comes with the territory with lifestreaming, you need to look into caching, which should be supported by your solution from the start, and how to run the content fetching scripts without slowing down the site. Again, most decent plugins support this, and so does SimplePie if you want to dive into that. The best solution is a cronjob, so talk to your Web host about that, and make sure whatever plugin or service you want to use supports it.

Legal Disclaimer

Our website is not responsible for the information contained by this article. Articleinput.com is a free articles resource thus practically any visitor can submit an article. However if you notice any copyrighted material, please contact us and we will remove the article(s) in discussion right away.

Note: This article was sent to us by: Jason D. at 05132010

Related Articles

1. Social Web Submit Buttons plugin Worspress
Social Web Submit Buttons The social Web is certainly a big consideration when working with editorial content today. While search engines can trickle in visitor...

2. Wordpress Hosted Comment Solutions
Pimping the Comments With the addition of threaded comments in the WordPress core, and the excellent CSS styling options that are now available, as well as the ...

3. How to Backing Up database for Wordpress
Backing Up Anyone who has lost data in a hard drive crash or similar knows the importance of backing up, and it goes without saying that this applies to your on...

4. What you need to know about the Wordpress database
Hacking the Database Most of the time you needn’t worry about the database; WordPress will do that for you. There are database changes between versions so...

5. Switch hosts with wordpress when export and import do not work
WordPress and Switching Hosts There are several ways of moving to a new server. My preferred one is using the Export/Import functionality found under Tools in W...

6. Do not share your MySQL user with any other system
Server Stuff The MySQL user for your WordPress database, which incidentally shouldn’t be shared with any other system, doesn’t actually need all wri...

7. What is WordPress core and how to use template tags
About the WordPress Core Any good CMS will keep its core files apart so that you don’t ruin the code that makes the system work, and WordPress is no excep...

8. Creating multiple loops might harm your WordPress blog
Alternatives to the Loop You may be tempted to create multiple loops or advanced loop queries in your theme’s template files when you’ve figured out...