Warning: this content is older than 365 days. It may be out of date and no longer relevant.

Image via Wikipedia


As of September 1, 2010, Twitter has nuked functions like this from orbit. I now recommend you download and install the paid TweetAdder software that does substantially the same thing but is compliant with Twitter’s OAuth protocols.

The old post is kept below only for historical purposes.

Ever since announcing that I’d basically follow anyone who’s followed me, I had to come up with a way to make this happen in a timely, efficient process. So here’s how I do it, if you want to use this bizarre workflow yourself.

  1. Aggregate all the “now following you” emails from Twitter in Mozilla Thunderbird.
  2. In Thunderbird, filter all these to a separate folder.
  3. On disk, open the Twitter folder in BBEdit.
  4. Extract all the lines containing “is now following”.
  5. De-dupe, then dump these into a text file.
  6. Strip out the Twitter usernames in parentheses.
  7. Copy and paste that list into a plain text file I call follow.txt.
  8. Run fu.php (a php script) to process those user names.
  9. Done!

fu.php is more or less the magic sauce along with BBEdit. I do this once every day or so to sync up new followers, and it works like a charm. fu.php I run in the Mac OS Terminal. This process looks complex, but in reality, it takes all of 2 minutes to do at most.

Here’s the source code:

// curl twitter follow script


function follow(username)
url = “https://username:[email protected]/friendships/create/username.json”;

if (!curld = curl_init()) {
echo “Could not initialize cURL session.\n”;

echo url;
if (!
curld = curl_init()) {
echo “Could not initialize cURL session.\n”;

curl_setopt(curld, CURLOPT_GET, true);
curld, CURLOPT_URL, url);
curld, CURLOPT_HEADER, false);
curl_setopt(curld, CURLOPT_RETURNTRANSFER, true);output=curl_exec(curld);

//echo “Received data: \n\noutput\n\n”;

return pile;

}handle = @fopen(“follow.txt”, “r”);
if (handle) {
while (!feof(
handle)) {
users[] = fgets(handle, 4096);

foreach(users as key=>value){


You might also enjoy:

Want to read more like this from Christopher Penn? Get updates here:

subscribe to my newsletter here

AI for Marketers Book
Get your copy of AI For Marketers

Analytics for Marketers Discussion Group
Join my Analytics for Marketers Slack Group!