-
-
Save danielmitterdorfer/7b5c5698cd9c07a99ce8375dd11bf6ea to your computer and use it in GitHub Desktop.
Weekly progress report with Trello
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 | |
# 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