Created
December 29, 2018 08:04
-
-
Save cohki0305/e54dccf2b925ad7b76e85a9b4044fd9b to your computer and use it in GitHub Desktop.
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
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