Created
August 18, 2015 02:16
-
-
Save arisawa/5f9d76c968e78d1def7b to your computer and use it in GitHub Desktop.
ミーティング時に動かした trello のカードを markdown の list 形式で書き出す
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'trello' | |
require 'dotenv' | |
require 'pry' | |
Dotenv.load | |
Trello.configure do |config| | |
config.developer_public_key = ENV['TRELLO_DEVELOPER_PUBLIC_KEY'] | |
config.member_token = ENV['TRELLO_MEMBER_TOKEN'] | |
end | |
today = ARGV.empty? ? Date.today : Date.parse(ARGV.first) | |
actions = Trello::Board.find(ENV['TRELLO_BOARD_ID']).actions( | |
before: today.to_s, | |
since: (today - 1).to_s, | |
limit: 1000 | |
) | |
actions.each_with_object({}) do |action, hash| | |
card_data = action.data['card'] | |
next if hash[card_data['id']] | |
puts "* [#{action.card.list.name}: #{card_data['name']}](#{action.card.url})" | |
hash[card_data['id']] = 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment