• Track your Campfire Usage with Campfire Spider

    photo
    • robert
    • July 30th, 2008
    • 12:24:22 PM

    For those of you that read every word I say, you might have noticed that I hinted at another project that Allyn and I were working on in our free time. Well, the time has come to unveil our mini project.

    It is a little known fact that Brightmix uses Campfire for office chat. Despite the fact that we are all within an earshot of one another, everyone still uses it to pass messages back and forth. Although, the conversations are not always… productive, it still has a lot of valuable information (Like SVN integration)

    Campfire itself has a lot of features, like file uploads, integrated pictures and YouTube videos, and so on. If you really want a list of features, check out their website.

    Probably my favorite, undocumented feature, of Campfire is using the @ in chat to auto-complete someones name. It is something I have found myself using in other chats besides Campfire, just to find that it does not complete their name for me!

    Although, it does not always work in our Campfire because we get rather creative with our names from time to time with characters that are not on my keyboard.

    Anyways, it was been mentioned a while back that campfire has turned into a cesspool ever since “The Interns” arrived. Being that we’re computer scientists, Allyn and I took it upon ourselves to actually see if this was true by measuring the increase in the number of campfire messages since our arrival.

    To do this, we wrote a little Ruby application that would go through the transcripts of all Campfire messages and count ‘em up! We actually started coding this (and completed it) after our second day of work at BrightMix from Allyn’s apartment, and we didn’t even have internet at the time. We wrote the whole parser from four saved html files that we grabbed while we were at work.

    Of course, we were not to familiar with Ruby at the time since we had literally started using it 2 days prior; as a result, we ran into some problems. We ended up going to a gas station down the street from us, Cubby’s, which offers free WiFi and we looked up the solutions to our problems, then returned to Allyn’s apartment.

    We hacked at it the rest of the night, and by the next morning we had a “workable” version of the application. Though, it was not without its problems. The graph had issues showing up correctly, the parser wouldn’t work if you were on an admin account (Allyn and I just have normal accounts and we were not expecting some changes in the UI that admin accounts have), and there were a few timeout issues.

    We fixed these bugs… and there the script sat in my Documents folder for about two months.

    Last night I finally decided to clean up the graph display (we use Google Charts) so that it would be in a more postable form! Winner.

    So, without any more delay… I present, the Campfire Spider.

    It requires that you have Ruby installed, and you can use it as follows:

    ruby campfire_spider.rb campfire_subdomain username password

    So, if your campfire site was “brightmix.campfirenow.com”, your username was “bill@brightmix.com”, and your password was “omg123″, you would run:

    ruby campfire_spider.rb brightmix bill@brightmix.com omg123

    After you type in this command and it works (It will throw an exception if your login information was wrong), it will likely take anywhere from five to 500 minutes to complete. So, grab some food, or find a fun flash game to play - I don’t care what you do - just let it run. When it finishes, it spit out two URLs in your console. One will be the raw-google-charts URL… It’s kind of long and epic, so the second URL is a TinyURL version of the google-charts URL.

    You can then open that up in your favorite browser, and there will be a graph of Time vs Messages.

    In case you were wondering, this is the Brightmix campfire usage graph:

    Hope it works for you! Let me know if you run into any problems.

    Download Campfire Spider here!

    PS: If you look closely at the graph, campfire usage has gone up… but does that mean the quality of messages went down? I don’t know, maybe version 2.0 will have a signal vs noise detector.

    Comments

    dusty

    I find the day with 1200 messages to be a bit suspect… haha.

    kevin

    It was probably the day we tried figuring out what we all wanted for lunch.. That sucked away hours of productive time and involved hundreds of messages. To top it all off, I think we ended up getting stuff from Arby’s or some other uneventful fast food joint.

    Andrew

    Scraping and parsing the HTML sounds painful (and eventually brittle). Doesn’t the campfire ruby api give you any hooks into this information?

    allyn

    Andrew - Campfire doesn’t really have an API. There’s Tinder, but that’s susceptible to the same downfalls as doing it manually in the end. Regardless, you are right - using tinder would probably clean the code up a bit, though I’m not sure if we’ll ever switch the spider code to use it.

    We’ve got another campfire related app that uses tinder that should be released soon. :)

    dusty

    I could be wrong, but there are two “Campfire APIs”, Tinder & Marsmallow?.. They are nothing more than an object model on top of a screen scraper. Its not like they have some level of access to 37signals stuff, they are 3rd party APIs. And, they’re mostly centered around posting and reading messages, not combing through the archives…

    Bill K

    Looks like it was the 23rd or 24th of June. I believe there was a gigantic business card discussion at that time in one of the rooms as well.