Git Product home page Git Product logo

go-trello's Introduction

Golang Trello API client

go-trello is a Go client package for accessing the Trello API.

PkgGoDev Travis Coverage Status

Example

Prerequisites:

  • Retrieve your appKey: https://trello.com/app-key (NOTE: This identifies "you" as the developer of the application)
  • Retrieve your (temporary) token: (put the space there to prevent the link) https ://trello.com/1/connect?key=${MYKEYFROMABOVE}>&name=${MYAPPNAME}&response_type=token&scope=read,write&expiration=1day
package main

import (
  "fmt"
  "log"

  "github.com/TJM/go-trello"
)

func main() {
  // New Trello Client
  appKey := "application-key"
  token := "token"
  trello, err := trello.NewAuthClient(appKey, &token)
  if err != nil {
    log.Fatal(err)
  }

  // User @trello
  user, err := trello.Member("trello")
  if err != nil {
    log.Fatal(err)
  }
  fmt.Println(user.FullName)

  // @trello Boards
  boards, err := user.Boards()
  if err != nil {
    log.Fatal(err)
  }

  if len(boards) > 0 {
    board := boards[0]
    fmt.Printf("* %v (%v)\n", board.Name, board.ShortURL)

    // @trello Board Lists
    lists, err := board.Lists()
    if err != nil {
      log.Fatal(err)
    }

    for _, list := range lists {
      fmt.Println("   - ", list.Name)

      // @trello Board List Cards
      cards, _ := list.Cards()
      for _, card := range cards {
        fmt.Println("      + ", card.Name)
      }
    }
  }
}

prints

Trello
* Bucket List (https://trello.com/b/Nl2oG77n)
   -  Goals
      +  How To Use This Board
      +  Do volunteer work
   -  Up Next
      +  Solve a Rubik’s Cube!
      +  Visit Japan
   -  Underway
      +  Improve writing skills
   -  Done!
      +  Learn to sail

Acknowledgements

Forked From:

(previously) Influenced by:

License

Licensed under the Apache License, Version 2.0.

go-trello's People

Contributors

aqatl avatar dennmart avatar eparis avatar fiatjaf avatar frenchben avatar gedex avatar lmsilvera avatar lostsnow avatar myyra avatar ryane avatar tjm avatar vncntvandriessche avatar vojtechvitek avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.