idonethis

package module
v0.0.0-...-eb5f07d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2014 License: BSD-2-Clause Imports: 10 Imported by: 0

README

iDoneThis Go API

This library was written by observing the way that the iDoneThis website functions and noticing that it uses a JSON API internally to retrieve information. This library was then written to take advantage of that API so I could write little programs to watch iDoneThis, post to iDoneThis, etc. There's a bit of screen scraping to get to the JSON api, which is in the NewClient function.

As I could not find API documentation for the JSON API, I did the best I could as far as finding urls and options. If you have documentation, or new urls that aren't part of the client, feel free to file an issue with the information or even write it up as a pull request.

Todo's

  • Other done filters?
  • Parse all fields of Team struct
  • Examples of origin field on dones
  • Examples of rawintegrationdata on dones
  • Date parser for the Done struct
  • Commenting on Dones
  • Documenting API

Documentation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	UserName string

	TeamName string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(username, password string) (*Client, error)

func (*Client) AllDones

func (c *Client) AllDones() ([]Done, error)

func (*Client) CurrentUser

func (c *Client) CurrentUser() (User, error)

func (*Client) FilteredDones

func (c *Client) FilteredDones(df DoneFilter) ([]Done, error)

func (*Client) FollowData

func (c *Client) FollowData() ([]Follow, error)

func (*Client) LikeDone

func (c *Client) LikeDone(d Done) error

func (*Client) PostDone

func (c *Client) PostDone(text string) (Done, error)

func (*Client) Tags

func (c *Client) Tags() ([]Tag, error)

func (*Client) Team

func (c *Client) Team() (Team, error)

func (*Client) TeamMembers

func (c *Client) TeamMembers() ([]User, error)

type Done

type Done struct {
	Id            int    `json:"id"`
	TeamShortName string `json:"team_short_name"`
	DoneDate      string `json:"done_date"`
	Owner         string `json:"owner"`

	Text         string `json:"text"`
	MarkedupText string `json:"markedup_text"`

	Tags     []Tag  `json:"tags"`
	Comments []Done `json:"comments"`
	Likes    []Like `json:"likes"`
}

type DoneFilter

type DoneFilter struct {
	Tags       []string
	Start, End time.Time
	Page       int
	PerPage    int
}

func (DoneFilter) String

func (df DoneFilter) String() string

type Follow

type Follow struct {
	Id       int    `json:"id"`
	Follower string `json:"follower"`
	Followee string `json:"followee"`
}

Follower and followee strings are the Usernames of the follower and followee

type Like

type Like struct {
	Email string `json:"user"`
}

type Tag

type Tag struct {
	Id      int    `json:"id"`
	Name    string `json:"name"`
	DoneIds []int  `json:"done_ids"`
}

type Team

type Team struct {
	Name        string `json:"name"`
	ShortName   string `json:"short_name"`
	Active      bool   `json:"active"`
	MemberCount int    `json:"member_count"`
	Question    string `json:"question"`
}

type User

type User struct {
	Id            int `json:"id"`
	TeamProfileId int `json:"team_profile_id"`

	Username   string `json:"username"`
	FirstName  string `json:"first_name"`
	LastName   string `json:"last_name"`
	NicestName string `json:"nicest_name"`

	HasJoined bool `json:"has_joined"`
	IsStaff   bool `json:"is_staff"`
	IsAdmin   bool `json:"is_admin"`

	Email           string   `json:"email"`
	AvatarUrl       string   `json:"avatar_url"`
	AlternateEmails []string `json:"alternate_emails"`
}

Directories

Path Synopsis
notifiers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL