Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gravityblast/coderwall-go
A Go client for the Coderwall API
https://github.com/gravityblast/coderwall-go
Last synced: about 9 hours ago
JSON representation
A Go client for the Coderwall API
- Host: GitHub
- URL: https://github.com/gravityblast/coderwall-go
- Owner: gravityblast
- License: mit
- Created: 2013-06-25T19:51:24.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-08-15T13:06:31.000Z (about 11 years ago)
- Last Synced: 2023-07-11T21:14:28.970Z (over 1 year ago)
- Language: Go
- Size: 133 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Coderwall
Coderwall API client for [go](http://golang.org/ "Go lang").
## Installation
go get github.com/pilu/coderwall-go
## Usage
package main
import (
"github.com/pilu/coderwall-go"
"fmt"
"flag"
"os"
)func usage() {
fmt.Fprintf(os.Stderr, "usage: coderwall USERNAME\n")
flag.PrintDefaults()
os.Exit(1)
}func main() {
flag.Usage = usage
flag.Parse()args := flag.Args()
if len(args) < 1 {
usage()
os.Exit(1);
}
client := coderwall.NewClient()
profile, err := client.GetProfile(args[0])
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Printf("%s, %s (%s) - %d endorsement\n\n", profile.Username, profile.Name, profile.Location, profile.Endorsements)
fmt.Printf("Badges (%d):\n\n", len(profile.Badges))
for _, badge := range(profile.Badges) {
fmt.Printf("\t%s\n\t\t%s\n\n", badge.Name, badge.Description)
}
}