Skip to content

patrickmn/go-wikimedia

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
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)
}

About

A Go interface to the Wikimedia (Wikipedia, Wiktionary, etc.) API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages