|
1 | 1 | # Quotable
|
2 | 2 |
|
3 |
| -[](https://gitmoji.dev) |
4 |
| -[](https://opensource.org/licenses/MIT) |
5 |
| - |
6 |
| - |
| 3 | +[](https://goreportcard.com/report/github.com/UltiRequiem/dadjokes) |
| 4 | +[](https://pkg.go.dev/github.com/UltiRequiem/dadjokes/pkg) |
7 | 5 |
|
8 | 6 | 
|
9 | 7 |
|
10 |
| -A golang wrapper around the [Quotable.io API](https://api.quotable.io/random). |
| 8 | +A wrapper around the [Quotable.io API](https://api.quotable.io). |
11 | 9 |
|
12 |
| -## Installation |
| 10 | +```go |
| 11 | +import ( |
| 12 | + "fmt" |
| 13 | + "github.com/UltiRequiem/quotable/pkg" |
| 14 | +) |
13 | 15 |
|
14 |
| -If you just want to use the CLI app: |
15 | 16 |
|
16 |
| -```bash |
17 |
| -go install github.com/UltiRequiem/quotable@latest |
18 |
| -``` |
| 17 | +func main(){ |
| 18 | + data, error := quotable.GetQuotable() |
19 | 19 |
|
20 |
| -To be able to execute the command anywhere you need to have correctly setup your |
21 |
| -[Gopath](https://golang.org/doc/gopath_code). |
| 20 | + fmt.Printf("%s\n -%s\n", data.Content, data.Author) |
| 21 | +} |
| 22 | +``` |
22 | 23 |
|
23 |
| -Example: |
24 |
| -[Dotfiles](https://github.com/UltiRequiem/dotfiles/blob/53fece48cc95521e67a7a9277d6146aa14fe32f3/.zshrc#L32) |
| 24 | +## CLI |
25 | 25 |
|
26 |
| -If you want to use it in code: |
| 26 | +### Installation |
27 | 27 |
|
28 | 28 | ```bash
|
29 |
| -go get github.com/UltiRequiem/quotable/pkg |
| 29 | +go install github.com/UltiRequiem/quotable@latest |
30 | 30 | ```
|
31 | 31 |
|
32 |
| -## Usage |
33 |
| - |
34 |
| -CLI: |
| 32 | +### Usage |
35 | 33 |
|
36 | 34 | ```bash
|
37 | 35 | quotable
|
38 | 36 | ```
|
39 | 37 |
|
40 |
| -Code: |
| 38 | +Or an `X` quantity of times :👇 |
41 | 39 |
|
42 |
| -```go |
43 |
| -package main |
44 |
| - |
45 |
| -import ( |
46 |
| - "github.com/UltiRequiem/quotable/pkg" |
47 |
| - "fmt" |
48 |
| -) |
49 |
| - |
50 |
| -func main() { |
51 |
| - quote, _ := quotable.GetRandomQuoteAndAuthor() |
52 |
| - fmt.Println(quote) |
53 |
| -} |
| 40 | +```bash |
| 41 | +quotable 38 |
54 | 42 | ```
|
55 | 43 |
|
56 |
| -### Exports |
57 |
| - |
58 |
| -This package exports 3 things: |
59 |
| - |
60 |
| -- [`Quotable`](https://github.com/UltiRequiem/quotable/blob/main/pkg/root.go#L7): |
61 |
| - A struct with the properties that a fetch returns to the Quotable API. |
62 |
| -- [`GetQuotableObject`](https://github.com/UltiRequiem/quotable/blob/main/pkg/root.go#L18): |
63 |
| - It fetches the Quotable API, returns a |
64 |
| - [`Quotable`](https://github.com/UltiRequiem/quotable/blob/main/pkg/root.go#L7). |
65 |
| -- [`GetRandomQuoteAndAuthor`](https://github.com/UltiRequiem/quotable/blob/main/pkg/root.go#L27): |
66 |
| - Uses |
67 |
| - [`GetQuotableObject`](https://github.com/UltiRequiem/quotable/blob/main/pkg/root.go#L18) |
68 |
| - but only returns quote and author property. |
| 44 | +[Video Showcase](https://youtu.be/rfBqpPCBrDE) 📷 |
69 | 45 |
|
70 |
| -### License |
| 46 | +## Other Art |
71 | 47 |
|
72 |
| -This project is Licensed under the [MIT](./LICENSE.md) License. |
| 48 | +I also made this on [JavaScript](https://github.com/UltiRequiem/ranmess), |
| 49 | +[Python](https://github.com/UltiRequiem/quoteran), |
| 50 | +[a website](https://github.com/UltiRequiem/ulti-random-quotes), and |
| 51 | +[Rust](https://github.com/UltiRequiem/ruquotes). |
73 | 52 |
|
74 |
| -### Alternatives |
| 53 | +## Licence |
75 | 54 |
|
76 |
| -I also developed this in [Node.js](https://github.com/UltiRequiem/ranmess), |
77 |
| -[Rust](https://github.com/UltiRequiem/ruquotes), and |
78 |
| -[Python](https://github.com/UltiRequiem/quoteran). |
| 55 | +Licensed under the MIT License 📄 |
0 commit comments