Code Monkey home page Code Monkey logo

hipchat-exporter's Introduction

HipChat Exporter

CircleCI

Export the history (messages) of rooms from HipChat.

Motivation

Requirements

image

Usage

Step 1) Export rooms and save them to DB

bundle exec thor task:room:export

Step 2) Export the history of rooms to JSON files

# 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

Step 3) Save the history of rooms to DB

bundle exec thor task:history:save

Step 4) Export the messages to CSV files

bundle exec thor task:message:export

The messages CSV files are exported to dist directory.

Step 5) Import messages CSV files to Slack

Other (show tasks list)

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

Setup

git clone [email protected]: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)

Debugging

bundle exec pry

Testing

bundle exec rspec

Other

Reset the database

db:reset -> db:drop && db:create && db:migarete

bundle exec rake db:reset

Map room names in CSV file and rooms in DB and show room id list

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

hipchat-exporter's People

Contributors

inouetakuya avatar

Watchers

 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.