Conflagration: A better web feed subscriber widget
Sat 26 May 07 19:19 | Tags: Blogging, Meta, Software
Here's one for my fellow bloggers out there, specifically those who use the FeedBurner service to tweak and serve their web feeds. FeedBurner allows you display a little widget on your blog that shows you how many subscribers you have. Even if you don't use FeedBurner, you may have seen it around the web at big-name blogs like TechCrunch and John Chow, as well as smaller (though not as small as RGR…) blogs like Mac OS X Tips and Kumiko's Cash Quest. It looks like this.
![]()
I used to use this widget myself, for somewhat selfish reasons, but I was never too excited about it. Why? Because at every site it's displayed, it looks exactly the same, save for slight color variations. The same boxy design, the same ugly aliased font.
Now, if you look over to the sidebar on the right, you'll see a feed widget with a number that is quite different. How did I do that? I made my own widget which I call Conflagration. It gets the subscriber count from FeedBurner and creates a prettier and much more original image with it. I've even implemented a simple theme system which lets me create new designs apart from the code itself, so you don't have to know any programming to create new "themes." Along with the "RayGunRobot" theme which I'm using here, Conflagration also comes with these themes "out of the box:"

"BigTimeSkyBlue" theme (also comes in gray, pink and green).

"Tilted" theme. (It could use a little more work…)
Also, back when I began offering two versions of my feed, I wanted my widget to display the total subscriber count of both feeds. So I added a feature to display the total subscribers from as many feeds as you want.
Today I am making Conflagration available to the public at large for the grand price of zero, zip, zilch, free. It's still in "beta," so more features should be forthcoming, but it seems to work fairly well at present and there's no bugs that I know of. It's a little more difficult to set up than the standard FeedBurner widget, and you have to have a server which you can run PHP scripts off of (so Blogger/TypePad/LiveJournal/etc users are out of the loop for now), but if you're looking for features above and beyond what FeedBurner's widget can do, give it a try. And please don't hesitate to contact me or leave a comment if you have any questions, feature suggestions, or found bugs.
Also please contact me if you've created an aesthetically-pleasing theme which you'd like to share with others. I'm a programmer, not an artist, so I'd be glad to see more and better-looking themes made available for Conflagration than the ones that are currently included.
Oh, and have you checked out SigFeeder? That's another cool tool for bloggers which I've developed.
(By the way, if it looks like I'm linking to all those blogs in the first paragraph in the hopes that they'll notice the incoming link via Technorati, check this out, then start using Conflagration themselves and then link back to me, well, that's exactly what I'm doing. It's just one of those sneaky things bloggers do.)
Get more great Ray Gun Robot content sent directly to your feed reader or email inbox! Subscribe today!
Articles & Links — Via Email
Articles Only — Via Email
5 Comments | 0 Trackbacks |
| ![]()
Trackbacks
Comments
I'll try it out once I get some solid me time.
PS - Enough with the "here's what sneaky bloggers dippidy doo da?"
#2 | Andy Beard | 11 Jun 07 14:35
You might like my new implementation of this, great code.
I expect I am going to have to write a small tutorial on it.
#4 | Andy Beard | 13 Jun 07 17:59
Garrett I haven't gone digging into the code yet to see.
How is updating handled?
My subscriber base grows reasonably rapidly, but feedburner tend to update the counter at slightly different times each day, though mainly around midnight PST.
How frequently are you polling for data and how is the polling time determined?
I would honestly prefer multiple updates daily, so that it catches any late updates.
#5 | Garrett Albright | 13 Jun 07 20:57
The image is updated by a script which is triggerable by cron, so you just have to set the cron job to trigger more frequently if you want it to update more frequently.
…is how I'd like it to work, but since I can't count on users having access to cron on their server, much less knowing how to set it up, I do it a less elegant way; if the modification date on the cached image (Data/img.png) is over 24 hours old (or, more precisely, 86,400 seconds), the image is deleted and recreated. (The script won't ping FeedBurner for new numbers unless its count cache file (Data/count.text) is also over 24 hours old, but these two files will have the same creation time under normal operation.)
This means that the exact time that FeedBurner is pinged will "wander" depending on how much time passes between the 24 hour expiration period and when the script is called. Flawed? Possibly. Inelegant? Definitely. But it works, and the main priority while writing the script was to use as few CPU cycles and network packets as possible, both on the host server and on FeedBurner's.
All that being said, there is a simple way to change the 24 hour expiration period to something shorter (or longer) if you so desire. Open up img.php and find the declaration for the OLDAFTER constant on line 9. Change that value (remember it's in seconds) from 86400 to whatever works for you.


#3 | Garrett Albright | 11 Jun 07 21:52
All right, very cool. You seem to be the first Conflagration user besides myself. =] Please let me know if you have any problems or feature ideas.