No, you didn't read it wrong and it isn't a duplicate article. It's actually an addendum to "A FeedBurner Plain Text Feed Count for All My Feeds", which was written for use with PHP5. After fiddling with code for an hour or so, I just made a few minor changes and now it works with both PHP4 and PHP5. The only problem is that there's no error checking. You'll either get the feed count or 0, but I tested it in 30 minute intervals for 5 hours and never got a 0.
Code Replacement
This is the replacement code for Step 1 of the referenced article. You can copy and paste it since I use the Unfancy Quote plugin to remove the fancy quotes put in place by WordPress.
<?php
$feeds = array('feed1', 'feed2', 'feed3');
$path = '/document_root/directory/filename.txt';$fb = 0;
foreach ($feeds as $feed) {
$url="http://api.feedburner.com/awareness/1.0/GetFeedData?uri=$feed";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
$p = xml_parser_create();
xml_parse_into_struct($p, $data, $vals, $index);
xml_parser_free($p);
$fb += $vals[2]['attributes']['CIRCULATION'];
}
file_put_contents($path, $fb);
?>
The Quick Wrap-Up
The rest of the steps still apply as they were originally written. I hope this helps those of you who are still stuck using PHP4.



