https://github.com/aisk/browsercookies
Loads cookies from your browsers
https://github.com/aisk/browsercookies
Last synced: 7 months ago
JSON representation
Loads cookies from your browsers
- Host: GitHub
- URL: https://github.com/aisk/browsercookies
- Owner: aisk
- License: lgpl-2.1
- Created: 2018-10-05T11:42:33.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-11-13T01:36:33.000Z (over 1 year ago)
- Last Synced: 2025-05-01T10:13:46.882Z (about 1 year ago)
- Language: Go
- Size: 51.8 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# browsercookies
[](https://godoc.org/github.com/aisk/browsercookies)
[](https://goreportcard.com/report/github.com/aisk/browsercookies)
[](https://codeclimate.com/github/aisk/browsercookies/maintainability)
Make HTTP requests with cookies from your browsers!

*This is a Go port of richardpenman's [browsercookie](https://bitbucket.org/richardpenman/browsercookie).*
---
## Supported browsers:
- [x] FireFox
- [ ] Chrome
## Example:
```go
package main
import (
"fmt"
"io/ioutil"
"net/http"
"regexp"
"github.com/aisk/browsercookies"
)
func main() {
jar, err := browsercookies.LoadFireFox()
if err != nil {
panic(err)
}
httpclient := http.Client{Jar: jar}
resp, err := httpclient.Get("https://github.com/settings/profile")
if err != nil {
panic(err)
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
panic(err)
}
re := regexp.MustCompile(``)
fmt.Println(re.FindAllStringSubmatch(string(body), -1)[0][1]) // => aisk
}
```
## License:
LGPL