I had an old, defunct Campfire account with five years' worth of transcripts in it, some of them hilarious, others just memorable. Unfortunately, Campfire doesn't currently have an export function; instead it provides pages of individual transcripts. I wanted a script to export everything from all five years, using the Campfire API.
I found a Gist that looked pretty good:
but it wasn't quite right. So this is my modification, converted to a GitHub repo.
- Saves HTML, XML, and plaintext versions of chat transcripts.
- Exports uploaded files to a day-specific subdirectory for easy access.
- Reports and logs export errors so you know what you're missing.
Ruby 1.8.7 or later is required.
First, clone the GitHub repo:
$ git clone git://github.com/precipice/campfire-export.git
If you don't already have Bundler installed, do that now:
$ gem install bundler
Then install required gems via Bundler:
$ bundle install
There are a number of configuration variables clearly marked at the top of
campfire_export.rb. The script won't run without them. Make sure to edit
them before running the script, and also make sure not to check in your API
token on any public source repo.
END_DATE variables are inclusive (that is, if your
end date is Dec 31, 2010, a transcript for that date will be downloaded).
ruby campfire_export.rb and your transcripts will be exported into
campfire directory, with subdirectories for each site/room/year/month/day.
In those directories, any uploaded files will be saved with their original
filenames. (Note that rooms and uploaded files may have odd filenames -- for
instance, spaces in the file/directory names.) Errors that happen trying to
export will be logged to
The Gist I forked had a plaintext transcript export, which I preserved as
transcript.txt in each directory. However, the original XML and HTML are now
also saved as
transcript.html, which could be useful.
Days which have no messages posted will be ignored, so the resulting directory structure will be sparse (no messages == no directory).
- Room name changes are not noticed.
- Slow as all hell if you have file uploads.
As mentioned above, much of the work on this was done by other people. The Gist I forked had contributions from:
Also, thanks for comments and contributions:
- Marc Hedlund, firstname.lastname@example.org