by Mark Kornblum (@mkornblum)
@prometheusbrown, MC, Blue Scholars
current followers 1.19.2011: 5420
It's small program which takes a Twitter username, looks up that user's current follower-count, and then scales and modifies the user's Twitter avatar so that 1 dot = 1 follower. This has the nice side effect that two images created with it can be printed at the same DPI, and one can very quickly get a sense exactly how 2,000,000 followers compares to 200,000, and how that compares to 2,000.
When a username is entered, the program contacts Twitter to find that user's current number of followers. Next, it finds the nearest sqaure root of that number, and then fetches the user's avatar image and scales it so that each side is equal to the follower square root multiplied by 4. Finally, it begins drawing 1-pixel width lines on the image, spaced 3 pixels apart, which creates the "dots". The program is written primarily in PHP, uses the GD Library for graphics manipulations, and interacts with the Twitter API using the PHP Twitter class by Tijs Verkoyen. The "explore large images" viewer is created using the Seadragon AJAX Deep-Zoom viewer from Microsoft Live Labs.
Since most Twitter users do not have a perfect sqaure for a follower count, there is some margin of error. For popular users, the margin of error is pretty low - for the Conan print, the margin of error is 0.04%. For users with fewer followers, the margin of error is larger. Originally, the program drew every dot individually, which allowed for a zero margin of error. However, doing it that way proved to be really, really slow. Drawing lines instead of dots is quite a bit faster - well worth the slight tradeoff in accuracy.