Quotable
A golang wrapper around the Quotable.io API.
Installation
If you just want to use the CLI app:
go install github.com/UltiRequiem/quotable@latest
To be able to execute the command anywhere you need to have correctly setup your Gopath.
Example: Dotfiles
If you want to use it in code:
go get github.com/UltiRequiem/quotabler/pkg
Usage
CLI:
quotable
Code:
package main
import (
"github.com/UltiRequiem/quotable/pkg"
"fmt"
)
func main() {
quote, _ := quotable.GetRandomQuoteAndAuthor()
fmt.Println(quote)
}
Exports
This package exports 3 things:
Quotable
: A struct with the properties that a fetch returns to the Quotable API.GetQuotableObject
: It fetches the Quotable API, returns aQuotable
.GetRandomQuoteAndAuthor
: UsesGetQuotableObject
but only returns quote and author property.
License
This project is Licensed under the MIT License.