Skip to content

Instantly share code, notes, and snippets.

@mattfitzgerald
Created March 21, 2014 03:36
Show Gist options
  • Save mattfitzgerald/9679029 to your computer and use it in GitHub Desktop.
Save mattfitzgerald/9679029 to your computer and use it in GitHub Desktop.
require 'sinatra'
require 'trello'
get '/' do
Trello.configure do |config|
config.developer_public_key = ASK_MATT
config.member_token = ASK_MATT
end
# ["4ea9eac79a9748a79f05e77c", "SQUAWKBOX Activity"]
# ["51f1d1d405aa045a1e000649", "SQUAWKBOX Big Picture Planning"]
# ["530d85d89397ce5a6eac2c0b", "SQUAWKBOX Drag Queen"]
# ["5187629a3539305004004c0c", "SQUAWKBOX Product Specs"]
# ["51e75089e16b3e5f4800083b", "SQUAWKBOX Product Specs (old)"]
# ["50639f0091eba3c032512133", "SQUAWKBOX v2"]
# ["518314d27d1db32710000a8a", "SQUAWKBOX Requests"]
# ["51e752fc2f662ba57b00647d", "SQUAWKBOX Roadmap"]
# ["51ad45a001a31b271f000b8f", "SQUAWKBOX Tweaks"]
# ["51f1c773b65b537428007f79", "SQUAWKBOX Bugs"]
board_ids = []
board_ids << "51e752fc2f662ba57b00647d" # "SQUAWKBOX Roadmap"
board_ids << "51ad45a001a31b271f000b8f" # "SQUAWKBOX Tweaks"
board_ids << "51f1c773b65b537428007f79" # "SQUAWKBOX Bugs"
board_ids << "518314d27d1db32710000a8a" # "SQUAWKBOX Requests"
boards = board_ids.map{|board_id| Trello::Board.find(board_id)}
boards = board_ids.map do |board_id|
board = Trello::Board.find(board_id)
lists = board.lists.reverse
cards = board.cards
board_summary = {name: board.name}
board_summary[:lists] = lists.map{|list| {name: list.name, cards: cards.select{|card| card.list_id == list.id}.map(&:name)} }
board_summary
end
erb :index, locals: {boards: boards}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment