~poptart/x

ref: 197bcbf285bb2a64f7e524b8ea051918f0253ec8 x/cmd/uacmd.go -rw-r--r-- 398 bytes
197bcbf2 — terrorbyte Added UA basics. 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package main

import (
	"fmt"
	"git.sr.ht/~poptart/x/ua"
	"os"
)

func main() {
	if _, err := os.Stat("/home/poptart/.config/hosaka_uacache"); err == nil {
		b, _ := useragent.GetUACache("/home/poptart/.config/hosaka_uacache")
		fmt.Println(b.UserAgent)
	} else if os.IsNotExist(err) {
		e := useragent.SaveUACache("/home/poptart/.config/hosaka_uacache")
		if e != nil {
			fmt.Println(e)
		}
	}
}