8

Stack on Go - A wrapper library in Go

https://github.com/laktek/Stack-on-Go

Sample Code

session := stackongo.NewSession("stackoverflow")

//set the params
params := make(stackongo.Params)
params.Add("filter", "total")
params.Pagesize(100)
params.AddVectorized("tagged", []string("go", "ruby", "java"))

questions, err := session.AllQuestions(params)

//iterate through results
for _, question := range questions.Items {
  fmt.Printf("%v\n", question.Title)
  fmt.Printf("Asked By: %v on %v\n", question.Owner.Display_name, time.SecondsToUTC(question.Creation_date))
  fmt.Printf("Link: %v\n\n", question.Link)
}

For more details check this Blog Post.

About

Stack on Go is a wrapper library written in Golang for Stack Exchange API 2.0. It's compatible with Google AppEngine's Go runtime, allowing you to easily deploy your apps.

Stack on Go fully implements the Stack Exchange API 2.0 and there's test coverage for all methods (you can use the test cases as a guideline on how to call the methods).

This library (combined with Google AppEngine) could be a good platform for those who want to hack on a hobby project to learn Go.

Examples

You will find bunch of examples included with the source code.

https://github.com/laktek/Stack-on-Go/tree/master/examples

License

MIT License

Download

https://github.com/laktek/Stack-on-Go/downloads

Source

https://github.com/laktek/Stack-on-Go

Platform

Stack on Go is compatible with Go1.

Contact

Lakshan Perera - http://laktek.com

Please report all issues and suggestions in GitHub Issues

4
  • 1
    I just can't get this to work, when I do go get github.com/laktek/Stack-on-Go (as go get has replaced goinstall) I get import errors on http, json and url?
    – Jonathan.
    Commented Apr 1, 2012 at 15:32
  • I think this needs to be updated to Go 1. Will do it soon and post an update
    – laktek
    Commented Apr 2, 2012 at 23:53
  • I realised this shortly after asking, and then found that Go has a neat command, go fix which fixed all but one error, which was not hard to fix (for someone who only just knew about Go). Thank you for this library, it's cut down on a lot of relatively boring code that got unwieldy quickly in Java.
    – Jonathan.
    Commented Apr 2, 2012 at 23:55
  • 2
    I've updated Stack on Go to fully support Go1. You should be able to use it without any modifications.
    – laktek
    Commented Apr 14, 2012 at 7:20

0

You must log in to answer this question.

Browse other questions tagged .