Skip to content

Instantly share code, notes, and snippets.

@cohki0305
Created December 29, 2018 08:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cohki0305/e54dccf2b925ad7b76e85a9b4044fd9b to your computer and use it in GitHub Desktop.
Save cohki0305/e54dccf2b925ad7b76e85a9b4044fd9b to your computer and use it in GitHub Desktop.
require 'trello'
require 'pry'
def puts_todos
configure
cards = get_cards
puts '----------------------'
puts '【TODO】'
cards.each do |card|
puts card.name
end
puts '----------------------'
end
def configure
Trello.configure do |config|
config.developer_public_key = ENV['TRELLO_PUBLIC_KEY']
config.member_token = ENV['TRELLO_MEMBER_TOKEN']
end
end
def get_cards
member = Trello::Member.find('todakoki')
boards = member.boards
board = boards.find { |board| board.name == 'TODO' }
list = board.lists[0]
cards = list.cards
cards
end
puts_todos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment