Export the history (messages) of rooms from HipChat.
- Ruby 2.5.0
- MySQL
- Why this tool need a database? (in Japanese)
- version 5.6.4+, why? -> The date in HipChat need microseconds (6 digits) precision
- utf8mb4, why? -> The messages in HipChat include emoji
- HipChat API Token:
bundle exec thor task:room:export
# bundle exec thor help history:export
Usage:
thor task:history:export
Options:
[--from=FROM] # Date (or Time) like "20180101"
[--to=TO] # Date (or Time), like "20180131", default is Time.current
[--threads=N] # Threads count for speedup blocking operations
[--force] # Skip asking questions
Example:
bundle exec thor task:history:export --from=20171101 --to=20171107 --threads=20
bundle exec thor task:history:save
bundle exec thor task:message:export
The messages CSV files are exported to dist
directory.
bundle exec thor -T
task
----
thor task:history:clear # Remove room history JSON files
thor task:history:export # Export the history of rooms to JSON files
thor task:history:save # Save the history of rooms to DB
thor task:message:clear # Remove messages CSV files
thor task:message:export # Export the messages to CSV files
thor task:room:export # Export rooms and save them to DB
thor task:room:map # Map room names in CSV file and room ids in DB
git clone git@github.com:livesense-inc/hipchat-exporter.git
cd hipchat-exporter
bundle install --path vendor/bundle
bundle exec rake db:create
bundle exec rake db:migrate
cp .env.example .env
Fill HIPCHAT_TOKEN
in .env
cp rooms.csv.example rooms.csv
Fill room_id and room_name in rooms.csv
(room_name is optional)
bundle exec pry
bundle exec rspec
db:reset -> db:drop && db:create && db:migarete
bundle exec rake db:reset
cp room_names.csv.example room_names.csv
Fill room names room_names.csv
bundle exec thor task:room:export
bundle exec thor task:room:map