Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jozsefsallai/go-strawpoll
strawpoll API wrapper for go
https://github.com/jozsefsallai/go-strawpoll
golang strawpoll
Last synced: about 2 months ago
JSON representation
strawpoll API wrapper for go
- Host: GitHub
- URL: https://github.com/jozsefsallai/go-strawpoll
- Owner: jozsefsallai
- License: mit
- Created: 2020-02-29T14:15:15.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-29T14:21:47.000Z (almost 5 years ago)
- Last Synced: 2024-08-17T00:57:38.640Z (5 months ago)
- Topics: golang, strawpoll
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-strawpoll
go-strawpoll provides an easy way to fetch and create polls from/to strawpoll.me.
## Getting Started
**Add go-strawpoll to your dependencies:**
```
go get -u github.com/jozsefsallai/go-strawpoll
```**To fetch a poll:**
```go
func main() {
poll, err := strawpoll.Get(1)
if err != nil {
panic(err)
}
fmt.Println(poll.Title)
}
```(where `1` is the ID of the poll on strawpoll.me)
**To create a poll:**
```go
func main() {
poll, err := strawpoll.Create(
"title of the poll",
[]string{"option 1", "option 2", "option 3"}, // at least 2
false, // multi-choice
strawpoll.DupcheckNormal, // duplication checking level
false, // require CAPTCHA
)if err != nil {
panic(err)
}fmt.Println(poll.ID)
}
```## Documentation
https://godoc.org/github.com/jozsefsallai/go-strawpoll
## License
MIT.