LoginSignup
1
2

More than 5 years have passed since last update.

Trelloのボードの内容を雑にMarkdownに加工するRubyスクリプト

Posted at
trello2md.rb
#! /usr/bin/env ruby
require 'trello'
require 'dotenv/load'
require 'pry'

Trello.configure do |config|
  config.developer_public_key = ENV['TRELLO_DEVELOPER_PUBLIC_KEY']
  config.member_token = ENV['TRELLO_MEMBER_TOKEN']
end

board_id = ARGV[0]
if board_id.nil?
  STDERR.puts 'no board id'
  exit 1
end

board = Trello::Board.find(board_id)
board.lists.each do |list|
  puts "# #{list.name}"
  puts
  list.cards.each do |card|
    puts "* #{card.name}"
    card.comments.each do |comment|
      puts "  * #{comment.text.gsub("\n", '<br>')}"
    end
  end
  puts
end
Gemfile
source 'https://rubygems.org'

gem 'ruby-trello'
gem 'dotenv'
gem 'pry'

使い方

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2