Sweetcron is "The Automated Lifestream Blog Software". It is still in public beta, but is already a very nice blog software package. The beauty of Sweetcron is that new posts are created automatically from your activity elsewhere on the web. New photos on Flickr? Tweets on Twitter? Thumbs up on StumbleUpon? Blog posts on Tumblr? Add them all to your Sweetcron-powered site and they will appear on your site in minutes.
Step 1: Download Sweetcron & Preparation
Sweetcron is free and open source! There is a Google Group that hosts the downloads, wiki, discussion group and all that. You'll get links to all that by going to the main Sweetcron site and entering your email to download/join.
Before you begin, know that you'll need to be running this on a server which is running PHP (at least version 5, I had to upgrade versions for my demo site). You will also need a MySQL (4.1) database and all the connection info (database name, database username, database password, database hostname).
Download the latest-greatest copy of Sweetcron and then upload the entirety of it to the directory on your web server you wish the blog to reside. The root directory, if you wish it to be at the root of your site, or in a subdirectory like /blog or /lifestream.
Note: included in the download is an .htaccess file which is required for Sweetcron to run correctly. Some operating systems like to hide this file, so if you don't see in in the directory you uploaded to, you'll need to create a new one (see the code below).

Step 2: Install Sweetcron
The first thing to do is verify your .htaccess file is in place and has the following code in it:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
Next, open system/application/config and rename the file "config-sample.php" to "config.php". Replace the URL with your sites URL. Then rename "database-sample.php" to "database.php" and fill in those details.
Note:If you are installing in a subfolder, there two extra steps.
- In config.php make sure the base_url is the full url path to your Sweetcron install, i.e. including subfolder.
- Open the .htaccess file found at the base of Sweetcron and change RewriteBase / to RewriteBase /
Now navigate to your site in a web browser and you should be greeted with the final steps for installation (setting your admin account and such).
Step 3: Configuration
After you've installed and verified that everything went smoothly, probably the best place to start is to start adding some feeds. Click onto the feeds tab and then the "Add new Feed" button on the right.

Simply drop in a feed address in this box and click the "Add This Feed" button. If you have the "real" feed address (e.g. http://feeds.feedburner.com/nettuts) that is your best bet. However, you can just drop in a regular website URL and it will attempt to auto-detect the feed on that site (e.g. http://nettuts.com/)
Now head over to the Options tab. Here you'll see the Title and Admin Email you've already set up, but there are some other important options here. Items per page is self-explanitory, Cron Type isn't so obvious. You have two options here: Psuedo-Cron and True Cron. What these options designate is how/when the software does a check of each of your feeds and looks for new items. Pseduo Cron is the default as it requires no server configuration. With Pseduo Cron, if it has been longer than 30 minutes, the next visitor to your site will trigger the job to go look for new feeds. Not a big deal, but that user will experience a longer than normal page load time. True Cron eliminates that problem by having the Server itself trigger that event. If you know what you are doing and can configure your own servers Cron Jobs, click that option and it will give you the URL to hit.
Right after you add your feeds and set your options, you may go back to your site only to find that there are no items! Don't worry, it's (probably) not broken. It's just that 30 minutes have not passed and the Cron job hasn't been triggered. If you want to "force it", go back to your options panel, click True Cron, copy the URL and visit it in a browser. This should pull in all your recent feed entries. Or (even easier), click over to the "Items" tab and press the "Fetch New Items Now" button.
Step 4: Administration
The real beauty of Sweetcron is the automation and lifestreaming capabilities, but it is also a regular blogging engine as well. Click the "Write" tab to write your own posts, including tagging!.
Another important note about Sweetcron is that it really is a blogging engine, not just a feed parser. What this means is that when it pulls in a new entry (say, a new Twitter Tweet) it makes an entry for that in the Database and that content now officially lives on your site. If you delete that Tweet on Twitter later on, or in any way change the content of the feed, that won't automatically change it on your site like it might if you were using a feed parser.
This leads to the last tab in the admin panel: "Items". This shows you each of the entries that you have either written and posted manually or that it has automatically grabbed from one of your feeds. This is very nice I think. You can easily edit, delete, or simple "unpublish" and particular entry on your site. This is the kind of simple control you want on a website
Step 5: Customization
At this point, your Sweetcron website looks something like this:

That is the default "Sandbox" theme. Not much to look at, but is very well built and a great place to start for designing your own theme! The theming structure for Sweetcron is fantastic and should be very familiar for anyone who has used WordPress.
Sweetcron comes with another theme, "Boxy", which Sweetcron's lead developer uses on his own personal site. Here is Yong Fook's site:

The "Boxy" theme shows off one of the really cool features of Sweetcron, and that is the ability to have each blog post be formatted differently according to its source. Notice how each of the different boxes (posts) on Jon's site looks different? The top left box is a photo from Flickr (with the title and info overlayed). The next box is a Twitter tweet (speech bubble with user icon). The top right is a "digg". You are not limited to any particular sources, you can create your own custom designs and apply them to your own custom sources!
Step 6: Designing a Custom Theme
As I mentioned, Sweetcron supports custom themes and works in a way very similar to WordPress. Themes exist as directories of the "themes" folder which lives at system/application/views/themes.

The easiest (and safest) way to get started is to simply duplicate one of the existing themes and modify from there. For my custom theme, I started with the Boxy theme, because it already had the custom-design per-source thing I wanted to use built in.
After you have duplicated and renamed one of the themes, that new theme will show up in the "Options" panel in the admin backend. Simply choose it and click the "Save Options" button.
Most of the files you'll see in your theme folder are fairly self-explanatory. The "_header.php" file is your DOCTYPE, head section, and beginning of your body. "._footer.php" closes things off (good place for your analytics and such) and "._sidebar.php" is (wait for it) your sidebar.
Perhaps the most important file of the theme is the "_activity_feed.php" file. This is the main content area of your theme and controls the boxes of each blog entry. Similar to the "WordPress loop" this file also contains a loop displaying as many posts as appropriate for that page
Here is the loop, simplified:
<ul id="activity_list">
<?php if ($items): $i = 1; foreach ($items as $item): ?>
<!-- begin conditional content -->
<li class="item <?php echo $item->get_feed_class()?> <?php if ($i % 3 == 0): ?> last<?php endif; ?>">
<!-- domain-specific boxes -->
<!-- SOURCE WAS: Twitter -->
<?php if ($item->get_feed_domain() == 'twitter.com'): ?>
<p class="site_info" style="background: url(<?php echo $item->get_feed_icon()?>) 3px center no-repeat"> </p>
<div class="item_inner">
<p class="twitter_user"><a href="<?php echo $this->config->item('base_url')?>items/site/<?php echo $item->get_feed_domain()?>"></a></p>
<p class="twitter_tweet"><?php echo $item->get_title()?></p>
</div>
<!-- SOURCE WAS: StumbleUpon -->
<?php elseif ($item->get_feed_domain() == 'chriscoyier.stumbleupon.com'): ?>
<p class="site_info" style="background: url(http://www.stumbleupon.com/favicon.ico) 3px center no-repeat"> </p>
<div class="item_inner">
<div class="inner_container">
<p class="digg_title"><a href="<?php echo $item->get_permalink()?>/<?php echo $item->get_name()?>"><?php echo $item->get_title()?></a></p>
<p><?php echo word_limiter(strip_tags($item->get_content()), 38)?></p>
</div>
<!-- SOURCE WAS: Sweetcron (manual blog entry) -->
<?php elseif (!$item->feed_id): ?>
<div class="inner_container">
<p class="blog_title"><a href="<?php echo $item->get_permalink()?>/<?php echo $item->get_name()?>"><?php echo $item->get_title()?></a></p>
<p class="blog_cite">A blog post</p>
</div>
<!-- SOURCE WAS: Generic Catch-All -->
<?php else: ?>
<div class="inner_container instructions">
<p>You don't have anything set up for this!</p>
</div>
<?php endif; ?>
<p class="date"><?php echo $item->get_human_date()?> | <a href="<?php echo $item->get_permalink()?>/<?php echo $item->get_name()?>">Comments »</a></p>
</li>
<?php $i ; endforeach; endif; ?>
</ul>
To create new custom treatments for posts from different sources, just copy and paste one of the PHP elseif statements from above and customize it. On my site, I am including my Twitter feed, StumbleUpon feed, Flickr feed, and the feeds for CSS-Tricks and my personal blog. I created special elseif statements for each of these sources, in case I want to do special styling for any of them.
This came in quite handy. Sweetcron provides a built in function for snagging favicons of the source, which worked for everything except StumbleUpon who's subdomains (chriscoyier.stumbleupon.com) prevent that from working. So because I had complete control over how that type of post is displayed, I simply told it to look in the right place manually (see StumbleUpon code above).
Here is what my custom theme looks like:

It is extremely simple. It simply lists the first line of the content of any given post. In the case of Twitter, it's the tweet itself. In the case of StumbleUpon, it's the link. In the case of CSS-Tricks, it's the title of the post. Each post shows its source by the favicon in the margin of the page.
Step 7: Single Page & Static Pages
Each blog post of yours will have a permalink as well, A.K.A, a "single" page. If you want to add comments to your site, this is the place to do it (single.php). Commenting isn't a built-in feature of Sweetcron, but it is simple enough to add with powerful easy-to-use systems like Disqus. In my theme, I used the dead-simple JS-Kit to add comments to my single pages (literally two lines of code).
If you want non-templated "static" pages for your site (like a Contact page), that is easy to do as well. Simply create a page called something like "contact_chris.php" in your theme directory, and that page will be available at http://your-site.com/sweetcron/contact_chris and the page title will automatically be "Contact Chris". Keep in mind the header and footer files will be automatically applied here, so you are just creating the main content area.
Wrapping Up
Our lives on the web are more scattered about now than they ever have been, but thanks to generous API's, open formats like RSS, and awesome software like Sweetcron, the personal website is not dead!
Sweetcron is a relatively new software, but its ease of use, great user interface and extensibility are surely going to be help it take off. I could see it amassing a huge user base and even stealing a little market share away from blogging giants like WordPress.
Related Posts
Check out some more great tutorials and articles that you might like












User Comments
( ADD YOURS )Craigsnedeker September 25th
Wow, this rocks! Thanks so much I’m gonna try this on my website!
Maor Hazan September 25th
Wow, thank you!
Jaswinder Virdee September 25th
Cool… i was looking into sweetcron… can’t wait to give it a try
Connor September 25th
Nice Post Chris! SweetCron looks promising…
Jbcarey September 25th
Didn’t know what sweetcron was till you showed me…. Nice stuff and this has some GOOD potential.
yongfook September 25th
Chris, thank you for this amazing tutorial!
This will help lots of people
Bill Biwer September 25th
Very cool, I think I’m going to stick with using the APIs and such for pulling into my site. Nice Tut none the less.
Aaron Irizarry September 25th
hah… another great tut Chris thanks.. I am definitely gonna give this s whirl
James September 25th
Very cool… And I like the word, “lifestream” - I’m so gonna include this in my new WP theme!
kim September 25th
I’ve been using Sweetcron since it was first release and it’s great!
Jay September 25th
Great post Chris - love it!
Sweetcron looks ’sweet’ and am sure I’m gonna try it as soon as i get the time! =)
Keep up the great work.
Best,
Jay
Chris Taylor September 25th
Great tutorial Chris - methinks I’ll have a play around with this soon.
Furley September 25th
this story from your lifestream is awesome
http://www.stumbleupon.com/demo/?src=favorites#url=http://css-tricks.com/body-border-2-fade-in-with-gradient/
Eric Cheung September 25th
It looks like a pretty good alternative of Tumblr
Also I kinda thought the file structure from the screenshots looked like it’s based on Codeigniter PHP Framework, no wonder why it is open source blog software 
Shane September 25th
Thanks for writing the tutorial Chris, I wasn’t aware of Sweetcron, and I always like hearing about new things.
For now, I think I’ll stick with Wordpress, but for certain Blogs, Sweetcron looks to do the trick!
Just one more thing, and please forgive me for slipping this in, but I dislike lined-paper designs.
Craigsnedeker September 25th
Hopefully I can find out how to set up the technical stuff
insic September 25th
This one is another amazing stuff i found in nettuts. I should make one.
Vladimir September 25th
COOL! Love your baseline grid design! I did something similar with Yahoo Pipes, various RSS into one ordered by date. Example: http://www.allapis.com/web-2.0-filter.aspx . But the problem with Yahoo Pipes is the support (you can’t control Yahoo). Now we have Sweetcron! Thank you Chris & NETTUTS!
James September 25th
Yes, actually I have a mild dislike towards websites which try to emulate lined paper. It confuses me!
w1sh September 25th
yongfook is a handsome man.
I’m gettin a broner!
Lamin Barrow September 25th
Cool App. Ah well it’s a shame it’s written in PHP lol.
Evan September 25th
“Cool App. Ah well it’s a shame it’s written in PHP lol.”
Huh? Whatever you say… Anyways, this looks great! Can’t wait to try it out.
Craigsnedeker September 25th
I put in my E-mail and didn’t get a download link.
Ben Griffiths September 25th
Really cool tutorial, thanks
ZaneGun08 September 25th
this is pretty cool… why is it asking me to login to twitter though when I go to the demo, as well as yong’s site?
Jordan Payne September 25th
Yet another brilliant tutorial, thanks Chris!
Matt September 25th
I thnk it’s better to use something like SimplePie along with your CMS of choice.
Diego Gomes September 25th
Rails Hitler!
where is the part 3?
Grim September 25th
It’s also possible to use WordPress and the FeedWordPress-plugin (http://projects.radgeek.com/feedwordpress).
Sam P. September 25th
Wow, great tutorial. What a great script as well
Mark September 25th
Fantastic. I was waiting on this for months. Then once it was released I realized it would’nt be simple to install so I was refreshed to see this. I’ll give it a try.
Colormono September 25th
Wowwww… Awesome tutorial!! I have my own Liftream right now… Thanks for share!
CodeIgniter it’s an excellent framework, Sweetcron it’s a beautifull blog software!!! Cheers!
Jorge Quinteros September 25th
I’m confused about this part: “Open the .htaccess file found at the base of Sweetcron and change RewriteBase / to RewriteBase /”. I’m changing RewriteBase to RewriteBase? I’m having problems with install.
Drew Douglass September 25th
This is a really cool and creative idea, thanks for the tutorial
Chris Barnett September 25th
Hey Chris, Great stuff with the internet becoming so “social”. Thanks for the tutorial.
Just a note:
Maybe you are aware or just don’t care, but take a look at the absolute positioning on your hand drawn links at the bottom. Using Firefox 3 on MAC they are a little off.
Cheers
Luanigio September 25th
Bello, bello, bello, bello!
Lo proverò subito.
Grazie per l’idea.
Ciao.
Rafyta September 25th
Cooooooooooool working on it:
http://rafyta.com
nitzan September 25th
not really managing to overtake the wordpress (nor habari) htaccess engine.
tried editing both htaccess in the root and in the sweetcorn folder.
any help would be great.
Shane September 26th
@Lamin - I’m from a Microsoft background, and the prevalence of great apps such as this, written in PHP, made me think I should learn it. Go for it - you won’t regret it.
Starry Nebula September 26th
Thank You! Will keep this in mind!
Crispy September 26th
Nice tutorial!
I keep getting this tutorial though, after step 2, when i try to open index.php:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@aboutchris.co.uk and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Crispy September 26th
@last post
any ideas why :(? been trying to fix for some time
thanks
Torley September 26th
I don’t have plans to do this anytime soon, but congrats on such a smashingly elegant tutorial — the presentation and content is exemplary, superb! Well-illustrated, well-sectioned and easy to follow.
GaB September 26th
Great tutorial man.
It seems you forgot to add when you explain how to install it in a subfolder instead of the root of your web site in Step 2:
2. Open the .htaccess file found at the base of Sweetcron and change RewriteBase / to RewriteBase /
GaB September 26th
oh you don’t display html tags that’s why…
RewriteBase /
Wayne September 26th
Exactly what I was looking for. Thanks for another great tut!
Chris Coyier September 26th
Hey ya’ll -
Check out this page for installation:
http://code.google.com/p/sweetcron/wiki/Installation
The .htaccess subfolder thing didn’t come across in the article because of the < problem. Should have been:
RewriteBase / to RewriteBase /YOUR_SUBFOLDER
There is also a google group for discussion:
http://groups.google.com/group/sweetcron?pli=1
David Pahl September 26th
RewriteBase / YourSubDirectory
Of course reading the docs is a good starting place, in general: http://code.google.com/p/sweetcron/wiki/Installation
Thanks Chris
Shawn September 26th
Been using SC since day one, and I can honestly say it’s my favorite self-hosted tool on the net.
Htoo Tay Zar September 27th
Ok, Thanks a lot Chris. I tried last night but didn’t success. I’ll check that Google group.
Chris Barnett September 27th
Not sure what the heck this guy is doing: http://www.mathieuwicke.be/
He had posted the link in a forum needing some help with a Wordpress theme.
He could have at least changed the logo, contact info, and the links to all of Chris’ social networks on the ‘invisible’ buttons at the bottom of the page..
What a nutcase.
yusufdestina September 27th
*lol*
Thank God there’s CI.
Nice work.
Finian September 27th
Great work and thanks for sharing this.
mohamedbitar September 28th
Hello everyone,
Those who have received the following error when performing the install:
[
Severity: Warning
Message: mail(): SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE MODE.
Filename: libraries/Email.php
]
can solve this by going into sweetcron/system/libraries/Email.php and having
var $_safe_mode = FALSE;
changed to
var $_safe_mode = TRUE;
MB
Alek September 28th
very cool. I think I want a lifestream now!
Steve September 30th
A plug for my Sweetcron site: http://www.exploitthesystem.com
Great article. Its very easy to set up. If you don’t know PHP and CSS its much harder to customize.
Follow the directions. If you get stuck post over on the Google Groups Sweetcron site:
http://groups.google.com/group/sweetcron
insic October 1st
this tool is really fun to use. i just finish mine, thanks for the tutorial.
Ryan October 1st
Hmmm…I’m trying to do this on a WAMP server and I followed the directions correctly but I keep getting a 404 error. Any ideas what I could be doing wrong?
Denis October 8th
Nice tutorial, thank you!
Taylor Satula October 9th
Yall could rig this beotch to be a customised feed reader. I don’t know i haven’t downloaded it yet.
Jonny Haynes October 14th
Hi Chris,
Using your article it took me less than 20 mins to have a fully functioning website up and running! Now to create my own theme!
Rob Enslin October 20th
Nice post Chris. I only wish I read it before I started… seems to make so much sense. Thanks.
10ha October 23rd
it’s actually based on CodeIgniter framework,
there’s a complete documentation available at http://codeigniter.com/user_guide/
webdesign November 19th
This is really nice im trying to get it customized as well. i will post when im done!
Add Your Comment
( GET A GRAVATAR )Your Name November 21st
Trackbacks