Skip to content

Commit a0482cc

Browse files
committed
📝 Add code snippet
1 parent 7217cfd commit a0482cc

File tree

2 files changed

+29
-52
lines changed

2 files changed

+29
-52
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
with:
1616
go-version: ${{ matrix.go }}
1717
- run: |
18-
go build cmd/main.go
18+
go build

readme.md

Lines changed: 28 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,55 @@
11
# Quotable
22

3-
[![GitMoji](https://img.shields.io/badge/Gitmoji-%F0%9F%8E%A8%20-FFDD67.svg)](https://gitmoji.dev)
4-
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5-
![Lines Of Code](https://img.shields.io/tokei/lines/github.com/UltiRequiem/quotable?color=blue&label=Total%20Lines)
6-
![CodeQL](https://github.com/UltiRequiem/quotable/workflows/CodeQL/badge.svg)
3+
[![Go Report Card](https://goreportcard.com/badge/github.com/UltiRequiem/quotable)](https://goreportcard.com/report/github.com/UltiRequiem/dadjokes)
4+
[![Go Reference](https://pkg.go.dev/badge/github.com/UltiRequiem/quotable/pkg.svg)](https://pkg.go.dev/github.com/UltiRequiem/dadjokes/pkg)
75

86
![Screenshot](./.github/assets/screenshot.png)
97

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).
119

12-
## Installation
10+
```go
11+
import (
12+
"fmt"
13+
"github.com/UltiRequiem/quotable/pkg"
14+
)
1315

14-
If you just want to use the CLI app:
1516

16-
```bash
17-
go install github.com/UltiRequiem/quotable@latest
18-
```
17+
func main(){
18+
data, error := quotable.GetQuotable()
1919

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+
```
2223

23-
Example:
24-
[Dotfiles](https://github.com/UltiRequiem/dotfiles/blob/53fece48cc95521e67a7a9277d6146aa14fe32f3/.zshrc#L32)
24+
## CLI
2525

26-
If you want to use it in code:
26+
### Installation
2727

2828
```bash
29-
go get github.com/UltiRequiem/quotable/pkg
29+
go install github.com/UltiRequiem/quotable@latest
3030
```
3131

32-
## Usage
33-
34-
CLI:
32+
### Usage
3533

3634
```bash
3735
quotable
3836
```
3937

40-
Code:
38+
Or an `X` quantity of times :👇
4139

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
5442
```
5543

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) 📷
6945

70-
### License
46+
## Other Art
7147

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).
7352

74-
### Alternatives
53+
## Licence
7554

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

Comments
 (0)