A Go interface to the Wikimedia (Wikipedia, Wiktionary, etc.) API
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README
wikimedia.go

README

go-wikimedia is an interface to the Wikimedia (Wikipedia, Wiktionary, etc.) API.

It is a work in progress currently used to build applications that query
Wikipedia and Wiktionary in different languages.

== Installation

go get github.com/pmylund/go-wikimedia

== Documentation

go doc github.com/pmylund/go-wikimedia
or http://go.pkgdoc.org/github.com/pmylund/go-wikimedia

== Usage

import (
	"fmt"
	"github.com/pmylund/go-wikimedia"
	"net/url"
)

w, err := wikimedia.New("http://en.wikipedia.org/w/api.php")
if err != nil {
	...
}
f := url.Values{
	"action": {"query"},
	"prop":   {"extracts"},
	"titles": {"Osmosis|Procrastination"},
}
res, err := w.Query(f)
if err != nil {
	return nil, err
}
for _, v := range res.Query.Pages {
	fmt.Println(v.Title, "-", v.Extract)
}