Skip to content
This repository has been archived by the owner on Jul 25, 2019. It is now read-only.

hulloitskai/ticktick

Repository files navigation

ticktick

An unofficial Go client library for TickTick.

I reverse-engineered the TickTick API with the help of RayBB/node-ticktick-api, and a lot of digging around with the Insomnia REST client.

This client library is the result of those efforts.

Usage

Install

$ go get -u github.com/stevenxie/ticktick # install library

Integrate

import (
  "fmt"
  "github.com/stevenxie/ticktick"
)

// This program logs into TickTick, and lists all remaining tasks.
func main() {
  // Create a client instance.
  client, err := ticktick.NewClient()
  if err != nil {
    panic(err)
  }

  // Login as a user.
  if err = client.Login("email@example.com", "supersecure"); err != nil {
    panic(err)
  }

  // List all remaining (incomplete) tasks.
  tasks, err := client.GetTasks()
  if err != nil {
    panic(err)
  }
  for _, task := range tasks {
    fmt.Println(task.Title)
  }

  // Make a new task.
  task := ticktick.NewTask("Update the TickTick Go client!")
  task.Content = "Check for new pull requests / issues, and make new features."
  task.Priority = 1

  // Add task to the inbox on TickTick. The API will return an updated task
  // containing a unique ID, and certain other fields filled out by the server.
  updatedTask, err := client.AddTask(task)
	if err != nil {
		panic(err)
	}
	fmt.Printf("Added a new task, with an ID of: %d\n", updatedTask.ID)
}

Examples

See example/ for a more complete example of using client to interact with the TickTick API.

You can run this example with:

$ go run example/main.go

Project Setup

## Clone the repository.
$ git clone git@github.com:stevenxie/ticktick

## Configure githooks, dependencies, etc.
$ make setup

About

An unofficial Go client library for TickTick (https://ticktick.com).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published