Here’s how to show the number of feed subscribers on your blog without going through FeedBurner or any other service, all in javascript.

First, most feed fetcher bots pass the number of subscribers in the User-Agent header, you can get this in you web server log:

209.85.238.248 - - [23/Jun/2010:11:36:45 -0700] "GET /blog.atom HTTP/1.1" 304 169 "-" "Feedfetcher-Google; (+http://www.google.com/feedfetcher.html; 540 subscribers; feed-id=8309483740725605993)"

Here’s a dirty script that will parse the Apache log file and extract the number of subscribers and add them up:

# Path to your Apache log
LOG_PATH = "logs/macournoyer.com/http/access.log"

cmd = "grep subscribers #{LOG_PATH} | " +
      %q{sed -rn 's/^.*GET (\/.*) HTTP.*"-" "([A-Z].*) .*; ([0-9].*[0-9]) subscribers.*$/\2\1--\3/ p'}
      # outputs BotName/URL--<# of subscribers>

counts = Hash.new(0)

`#{cmd}`.each_line do |line|
  ip, count = line.split("--")
  counts[ip] = count.to_i if count.to_i > counts[ip]
end

puts counts.values.inject(0) { |sum, i| sum += i }

Next, create a Cron job to run this each day and save it to a file accessible online:

0 0 * * * ruby feedcount.rb > PATH_TO_YOUR_SITE_ROOT/feedcount.txt

Finally, you want to update the info on your site using jQuery:

$("#feedcount").load("/feedcount.txt");

Boom!