Skip to content

Latest commit

 

History

History
81 lines (66 loc) · 2.2 KB

README.md

File metadata and controls

81 lines (66 loc) · 2.2 KB

go-topcoder

go-topcoder is a Go client library for accessing the Topcoder API.

license Build Status Test Coverage GoDoc

go-topcoder requires Go version 1.6.2 or greater.

Getting Started

Usage

As a library:

import "github.com/maratonago/go-topcoder/topcoder"

Sample App

import (
  "encoding/json"
  "fmt"

  "github.com/maratonago/go-topcoder/topcoder"
)

func main() {
  profile, _, _ := topcoder.UserProfile.PublicProfile("paulocezar")

  sProfile, err := json.MarshalIndent(profile, "", "  ")
  if err != nil {
    panic(err)
  }

  fmt.Println(string(sProfile))
}

Above code would produce an output similar to:

{
  "handle": "paulocezar",
  "country": "Brazil",
  "memberSince": "2009-10-08T18:26:00.000-04:00",
  "quote": "",
  "photoLink": "https://topcoder-prod-media.s3.amazonaws.com/member/profile/paulocezar-1447891532103.png",
  "copilot": false,
  "overallEarning": 250,
  "ratingSummary": [
    {
      "name": "Algorithm",
      "rating": 1448,
      "colorStyle": "color: #6666FF"
    }
  ],
  "Achievements": [
    {
      "date": "2016-03-15T00:00:00.000-04:00",
      "description": "First Marathon Competition"
    },
    {
      "date": "2013-09-17T00:00:00.000-04:00",
      "description": "One Hundred Rated Algorithm Competitions"
    },
    {
      "date": "2013-03-03T00:00:00.000-05:00",
      "description": "Solved Hard Div1 Problem in SRM"
    }
  ]
}

LICENSE

Released under the MIT License.