https://github.com/jxsl13/dawum
dawum.de Go client
https://github.com/jxsl13/dawum
elections politics polls surveys
Last synced: 4 months ago
JSON representation
dawum.de Go client
- Host: GitHub
- URL: https://github.com/jxsl13/dawum
- Owner: jxsl13
- License: mit
- Created: 2023-09-29T22:19:28.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-29T22:22:51.000Z (about 2 years ago)
- Last Synced: 2024-06-21T08:19:36.416Z (over 1 year ago)
- Topics: elections, politics, polls, surveys
- Language: Go
- Homepage: https://dawum.de
- Size: 86.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dawum - a dawum.de Go client
This is a small utility for fetching German election poll data from the https://dawum.de api.
Reference: https://dawum.de/API/
# import dependency
```shell
go get github.com/jxsl13/dawum@latest
```# example usage
```go
package mainimport (
"fmt"
"github.com/jxsl13/dawum"
)func main() {
ExampleGetLastUpdate()
ExampleGetData()
}func ExampleGetData() {
data, err := dawum.GetData(context.Background())
if err != nil {
panic(err)
}fmt.Println(data)
// {"Database":{"License":{"Name":"ODC Open Database License","Shortcut":"ODC-ODbL","Link":"https........
}func ExampleGetLastUpdate() {
datetime, err := dawum.GetLastUpdate(context.Background())
if err != nil {
panic(err)
}fmt.Println(datetime)
// 2023-09-29T09:41:59+02:00
}
```