Twitrack – Keep track of unfollows

I’m not one of the sort of folks that gets irritated when people unfollow me on Twitter, but I do like to keep track of it.  Qwitter used to provide that service, but it’s been absent without leave for a good long while.

So I hacked together a little Ruby script that when run shows me the folks that have unfollowed me since the last run and a little info on them.  Just add your username / password right up there at the top and let the disgruntledness begin! Enjoy.

One thought to “Twitrack – Keep track of unfollows”

  1. Nice script, Scott. Thanks!

    Recently, however, the script started stalling out at a certain point and spewing out errors. Apparently a Twitter ID was suspended, gumming up the works. So I added a little rescue to the script at line 39. Hope it helps:

    begin
    document = REXML::Document.new(@resource[“users/#{id}.xml”].get(:accept => ‘text/xml’))

    screen_name = document.elements.to_a(‘//screen_name’).first.text
    description = document.elements.to_a(‘//description’).first.text
    name = document.elements.to_a(‘//name’).first.text

    puts name
    puts description
    puts “http://twitter.com/#{screen_name}”
    puts

    log.write(“#{name}n”)
    log.write(“#{description}n”)
    log.write(“http://twitter.com/#{screen_name}n”)
    rescue
    puts “Sorry, couldn’t retrieve ID #{id} (user may have been suspended).”
    puts

    log.write(“Sorry, couldn’t retrieve ID #{id} (user may have been suspended).”)
    end

Leave a Reply

Your email address will not be published. Required fields are marked *