-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
34 lines (27 loc) · 667 Bytes
/
main.go
File metadata and controls
34 lines (27 loc) · 667 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// source https://gist.github.com/dacort/bd6a5116224c594b14db
package main
import (
"fmt"
"os"
_ "github.com/mattn/go-sqlite3"
"github.com/nicksherron/cookies/pkg"
)
func usage() {
fmt.Fprintf(os.Stderr, "usage: %s [domain]\n", os.Args[0])
os.Exit(2)
}
func main() {
if len(os.Args) != 2 {
usage()
}
domain := os.Args[1]
output := ""
// TODO: Output in Netscape format
for _, cookie := range cookies.GetCookies(domain) {
// device_view=full;
tmp := fmt.Sprintf("%v=%v; ", cookie.Key, cookie.DecryptedValue())
output = output + tmp
//fmt.Printf("%s/%s: %s\n", cookie.Domain, cookie.Key, cookie.DecryptedValue())
}
fmt.Println(output)
}