Giter VIP home page Giter VIP logo

campfire_export's Introduction

campfire_export

Quick Start

$ sudo gem install campfire_export
$ campfire_export

Intro

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 and a Ruby gem.

Features

  • 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.
  • Obsessively confirms that everything was exported correctly.

Installing

Ruby 1.8.7 or later is required. RubyGems is also required -- I'd recommend having the latest version of RubyGems installed before starting.

Once you are set up, to install, run the following:

$ sudo gem install campfire_export

Configuring

There are a number of configuration variables required to run the export. The export script will prompt you for these; just run it and away you go. If you want to run the script repeatedly or want to control the start and end date of the export, you can create a .campfire_export.yaml file in your home directory using this template:

# Your Campfire subdomain (for 'https://myco.campfirenow.com', use 'myco').
subdomain:  myco

# Your Campfire API token (see "My Info" on your Campfire site).
api_token:  abababababababababababababababababababab

# OPTIONAL: Export start date - the first transcript you want exported.
# Uncomment to set. Defaults to the date each room was created.
#start_date: 2010/1/1

# OPTIONAL: Export end date - the last transcript you want exported.
# Uncomment to set. Defaults to the date of the last comment in each room.
#end_date:   2010/12/31

The start_date and end_date variables are inclusive (that is, if your end date is Dec 31, 2010, a transcript for that date will be downloaded), and both are optional. If they are omitted, export will run from the date each Campfire room was created, until the date of the last message in that room.

Exporting

Just run campfire_export and your transcripts will be exported into a campfire directory in the current directory, with subdirectories for each site/room/year/month/day. In those directories, any uploaded files will be saved with their original filenames, in a directory named for the upload ID (since transcripts often have the same filename uploaded multiple times, e.g. Picture 1.png). (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 campfire/export_errors.txt.

The Gist I forked had a plaintext transcript export, which I've kept in as transcript.txt in each directory. However, the original XML and HTML are now also saved as transcript.xml and 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).

Credit

First, thanks a ton to Jeffrey Hardy from 37signals, who helped me track down some bugs in my code as well as some confusion in what I was getting back from Campfire. His patient and determined help made it possible to get this working. Thanks, Jeff!

Also, thanks much for all the help, comments and contributions:

As mentioned above, some of the work on this was done by other people. The Gist I forked had contributions from:

Thanks, all!

campfire_export's People

Contributors

alex-hofsteede avatar andrewwong1221 avatar chaselee avatar juno avatar pat avatar precipice avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.