Skip to content

Instantly share code, notes, and snippets.

@arisawa
Created August 18, 2015 02:16
Show Gist options
  • Save arisawa/5f9d76c968e78d1def7b to your computer and use it in GitHub Desktop.
Save arisawa/5f9d76c968e78d1def7b to your computer and use it in GitHub Desktop.
ミーティング時に動かした trello のカードを markdown の list 形式で書き出す
#!/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