Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/aisk/browsercookies

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/aisk/browsercookies

  • v0.0.0-20241113013628-1a2b181f9f33
  • Source
  • Go
  • Socket score

Version published
Created
Source

browsercookies

GoDoc Go Report Card Maintainability

Make HTTP requests with cookies from your browsers!

cookie jar

This is a Go port of richardpenman's browsercookie.


Supported browsers:

  • FireFox
  • Chrome

Example:

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(`<meta name="user-login" content="(\w*?)">`)
	fmt.Println(re.FindAllStringSubmatch(string(body), -1)[0][1]) // => aisk
}

License:

LGPL

FAQs

Package last updated on 13 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc