Skip to content

Instantly share code, notes, and snippets.

@ondrae
Last active December 22, 2015 06:49
Show Gist options
  • Save ondrae/6434120 to your computer and use it in GitHub Desktop.
Save ondrae/6434120 to your computer and use it in GitHub Desktop.
This gist grabs the newest Trello board a user has created. Generate your own key at https://trello.com/c/jObnWvl1/25-generating-your-developer-key Get a users auth_token by following these instructions https://trello.com/docs/gettingstarted/index.html#getting-a-token-from-a-user Before I got that sort function working I had a nasty 18 line trip…
import requests
api_key = ''
auth_token = ''
response = requests.get('https://trello.com/1/member/me/boards?fields=id,name,dateLastView&key='+api_key+'&token='+auth_token)
boards = response.json()
boards.sort(key=lambda board : board["dateLastView"], reverse=True)
the_new_resource = boards.pop(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment