Made for Übersicht
The widget may require jq
(a lightweight and flexible command-line JSON processor).
This widget will display a chosen card from Trello
Edit index.coffee
accordingly.
Duplicate calls and methods to display more cards if necessary.
The ubersicht widget processes the information directly
update: (output, domEl) ->
data = JSON.parse(output)
for list of data
listData = data[list] if data[list].name is this.listName
$domEl = $(domEl)
$domEl.html("<div class='entry listName'>#{listData.name}</div>")
for item in listData.cards
$domEl.append @renderItem(item)
renderItem: (data) ->
"""
<div class='entry'>▪︎ #{data.name}</div>
"""
However, it can mine the information first, and then create an array to be displayed as following:
URL="https://api.trello.com/1/boards/$boardId/lists?fields=name&cards=open&card_fields=name&key=$apiKey&token=$token"
USER_AGENT="User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1535.3 Safari/537.36"
BOARD=$(curl -s $URL -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H "$USER_AGENT")
CATEGORY=$(echo "$BOARD")
echo "To Do :: TODAY"
echo "$CATEGORY" | jq '.[0].cards | .[].name'