Instantly share code, notes, and snippets.

Embed
What would you like to do?
Weekly progress report with Trello
#!/usr/bin/env ruby
# sudo gem install ruby-trello
# see docs in http://www.rubydoc.info/gems/ruby-trello
require 'trello'
Trello.configure do |config|
config.developer_public_key = ENV["TRELLO_DEVELOPER_PUBLIC_KEY"]
config.member_token = ENV["TRELLO_MEMBER_TOKEN"]
end
def cards(list)
c = []
list.cards.each do |card|
unless card.name.start_with?("//") then
c << "* #{card.name} #{card.desc}\n"
end
end
c
end
def lists(board)
l = []
board.lists.reverse_each do |list|
unless list.name == "Backlog" or list.name == "Blocked" then
c = cards(list)
unless c.empty?
l << "\n#{list.name}:\n\n"
l = l + c
end
end
end
l
end
puts("Status for #{Time.now.strftime('%Y-%m-%d')}")
puts("===")
puts("Hi,\n\nhere's my week:\n")
me = Trello::Member.find(ENV["TRELLO_USERNAME"])
me.boards.reverse_each do |board|
unless board.closed? then
l = lists(board)
unless l.empty?
puts("\n**#{board.name}**\n")
l.each {|list| puts list}
end
end
end
puts("\nDaniel")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment