Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3de1e98
Add travis
jsl Mar 17, 2015
2f5939a
Move classes into separate files, add default spec task to Rakefile
jsl Mar 17, 2015
2513ccd
Add missing require
jsl Mar 17, 2015
eaa3a15
Fix gem on Ruby 1.9+ by upgrading dependencies
jsl Mar 17, 2015
296abbc
Fix handling of Exception that is either too broad or ambiguous
jsl Mar 17, 2015
e4a7941
Remove unnecessary setter methods
jsl Mar 17, 2015
9910021
Whitespace
jsl Mar 17, 2015
d803386
Retry up to five times on TimeoutError
jsl Mar 17, 2015
af2bf92
Add retry around main get block
jsl Mar 18, 2015
e482525
Don't count characters, check the byte size of the String
jsl Mar 18, 2015
b3f5ba9
Ruby 1.8.7 is dead
jsl Mar 18, 2015
f07e16c
Message consistency tweak
jsl Mar 18, 2015
b72adc9
Version bump to 0.4.0
jsl Mar 18, 2015
598473d
README updates
jsl Mar 18, 2015
243f837
README update
jsl Mar 18, 2015
028e2a6
Allow providing room_name to only export that room
gabebw Dec 11, 2014
a99db37
Add documentation for room-specific export
jsl Mar 18, 2015
ae7a151
Doc update
jsl Mar 18, 2015
bff444f
Bump version to 0.4.1
jsl Mar 18, 2015
f367ffe
Correct yaml file extension to yml
Feb 8, 2014
22e5cf3
Update docs for new extension to campfire export config file
jsl Mar 18, 2015
a63b920
Update specs to fix deprecations, remove unimplemented spec
jsl Mar 18, 2015
238e61c
Remove sudo from README, other README tweaks
jsl Mar 18, 2015
45ccbdb
Bump version to 0.5.0
jsl Mar 18, 2015
5b685a3
fix last update date error handling
mikewebkist May 22, 2015
0a1cde7
fix exception handling
mikewebkist May 22, 2015
67b2bad
Merge branch 'fix-vars'
mikewebkist May 22, 2015
151d7e6
remove debugging code
mikewebkist May 22, 2015
1566025
Merge pull request #1 from mikewebkist/master
jsl Jun 21, 2015
0d4b517
Revert change to current time
jsl Jun 21, 2015
1cb1f94
Bump version to 0.5.1
jsl Jun 21, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: ruby
rvm:
- 1.9.3
- 2.0
- 2.1
- 2.2
41 changes: 35 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,37 @@
[![Build Status](https://travis-ci.org/stackbuilders/campfire_export.png)](https://travis-ci.org/stackbuilders/campfire_export)

# campfire_export #

## Quick Start ##

$ sudo gem install campfire_export
$ gem install stackbuilders-campfire_export
$ campfire_export

## Note ##

This gem is a fork from the original version of this project by
[Marc Hedlund](https://github.com/precipice). While almost all of the work is
still his, this fork contains fixes and updates for user-facing issues,
including the following:

* Upgrade gem dependencies and add support for Ruby versions >= 1.9.3
* Retry up to 5 times before giving up on a resource. Makes campfire_export usable for large exports.
* Fixes file size validation when file contains Unicode.
* Allow export of a specific room instead of exporting all rooms on a Campfire account.

When you install the gem following the instructions above (i.e., with the name
stackbuilders-campfire-export) you will get these fixes, and the project will run
on modern Ruby versions.

We will try to respond to issues and pull requests on the
[Stack Builders](http://www.stackbuilders.com) fork of this repository
(https://github.com/stackbuilders/campfire_export), and to push new releases in
a timely manner to https://rubygems.org/gems/stackbuilders-campfire_export.

## Intro ##

I had an old, defunct [Campfire](http://campfirenow.com/) account with five
years' worth of transcripts in it, some of them hilarious, others just
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.
Expand All @@ -29,27 +52,27 @@ repo and a [Ruby gem](http://docs.rubygems.org/read/chapter/1).

## Installing ##

[Ruby 1.8.7](http://www.ruby-lang.org/en/downloads/) or later is required.
[Ruby 1.9.3](http://www.ruby-lang.org/en/downloads/) or later is required.
[RubyGems](https://rubygems.org/pages/download) 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
$ 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
the export, you can create a `.campfire_export.yml` 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
api_token: your-campfire-token

# OPTIONAL: Export start date - the first transcript you want exported.
# Uncomment to set. Defaults to the date each room was created.
Expand All @@ -59,6 +82,11 @@ directory using this template:
# Uncomment to set. Defaults to the date of the last comment in each room.
#end_date: 2010/12/31

# OPTIONAL: Campfire room - the room you want exported. All other rooms
# will be skipped.
# Uncomment to set. Defaults to all rooms.
#room_name: Stack Builders Website Dev

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
Expand Down Expand Up @@ -98,6 +126,7 @@ Also, thanks much for all the help, comments and contributions:
* [Junya Ogura](https://github.com/juno)
* [Chase Lee](https://github.com/chaselee)
* [Alex Hofsteede](https://github.com/alex-hofsteede)
* [Justin Leitgeb](https://github.com/jsl)

As mentioned above, some of the work on this was done by other people. The
Gist I forked had contributions from:
Expand Down
17 changes: 11 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
require 'rubygems'
require 'bundler'
Bundler::GemHelper.install_tasks
require "bundler/gem_tasks"

require 'rspec/core/rake_task'
rspec = RSpec::Core::RakeTask.new
rspec.rspec_opts = '-f Fuubar --color'

begin
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)

task :default => :spec
rescue LoadError
# no rspec available
end
14 changes: 9 additions & 5 deletions bin/campfire_export
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,27 @@ def ensure_config_for(config, key, prompt)
end

config = {}
config_file = File.join(ENV['HOME'], '.campfire_export.yaml')
config_file = File.join(ENV['HOME'], '.campfire_export.yml')

if File.exists?(config_file) and File.readable?(config_file)
config = YAML.load_file(config_file)
config = YAML.load_file(config_file)
end

ensure_config_for(config, 'subdomain',
ensure_config_for(config, 'subdomain',
"Your Campfire subdomain (for 'https://myco.campfirenow.com', use 'myco')")
ensure_config_for(config, 'api_token',
"Your Campfire API token (see 'My Info' on your Campfire site)")

begin
account = CampfireExport::Account.new(config['subdomain'],
account = CampfireExport::Account.new(config['subdomain'],
config['api_token'])
account.find_timezone
account.rooms.each do |room|
room.export(config_date(config, 'start_date'),
if config["room_name"] && room.name != config["room_name"]
next
end

room.export(config_date(config, 'start_date'),
config_date(config, 'end_date'))
end
rescue => e
Expand Down
34 changes: 20 additions & 14 deletions campfire_export.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,31 @@ $:.push File.expand_path("../lib", __FILE__)
require "campfire_export/version"

Gem::Specification.new do |s|
s.name = "campfire_export"
s.name = "stackbuilders-campfire_export"
s.version = CampfireExport::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Marc Hedlund"]
s.email = ["marc@precipice.org"]
s.authors = ["Marc Hedlund", "Justin Leitgeb"]
s.email = ["marc@precipice.org", "justin@stackbuilders.com"]
s.license = "Apache 2.0"
s.homepage = "https://github.com/precipice/campfire_export"
s.summary = %q{Export transcripts and uploaded files from your 37signals' Campfire account.}
s.description = s.summary
s.homepage = "https://github.com/stackbuilders/campfire_export"
s.summary = "Export transcripts and uploaded files from your 37signals' Campfire account."

s.description = %{Exports content from all rooms in a
37signals Campfire account. Creates a directory containing transcripts
and content uploaded to each one of your rooms. Can be configured to
recognize start and end date of content export.}

s.rubyforge_project = "campfire_export"
s.required_ruby_version = '>= 1.8.7'

s.add_development_dependency "bundler", "> 1.0.15"
s.add_development_dependency "fuubar", "~> 0.0.5"
s.add_development_dependency "rspec", "~> 2.6.0"
s.add_dependency "tzinfo", "~> 0.3.29"
s.add_dependency "httparty", "~> 0.7.8"
s.add_dependency "nokogiri", "~> 1.5.6"
s.required_ruby_version = '>= 1.9.3'

s.add_development_dependency "bundler", "~> 1"
s.add_development_dependency "rake", "~> 10"
s.add_development_dependency "rspec", "~> 2.6"

s.add_dependency "tzinfo", "~> 1.2"
s.add_dependency "httparty", "~> 0.13"
s.add_dependency "nokogiri", "~> 1.6"
s.add_dependency "retryable", "~> 2.0"

s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
Expand Down
Loading