MCPcopy Index your code
hub / github.com/Johnw7789/shape

github.com/Johnw7789/shape @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
7 symbols 19 edges 3 files 3 documented · 43% 16 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Note

This repository is now deprecated. Success rate is unknown. Feel free to fork and mofidy if desired.

Shape Harvester

Hijacks the requests from a headless browser in order to harvest required headers used for protected endpoints. After the headers are harvested the request is blocked so it cannot be completed.

This package could also be modified to allow multiple harvesters through the use of multiple pages (or incognito pages?) to simultaneously generate headers (potentially tens of thousands per minute).

Installation

go get github.com/Johnw7789/shape

Usage

Target

This harvester has only been tested on Target.com. Success on other sites may vary wildly.

// * The keys of the headers we want the values for
headerNames := []string{
    "X-GyJwza5Z-a",
    "X-GyJwza5Z-b",
    "X-GyJwza5Z-c",
    "X-GyJwza5Z-d",
    "X-GyJwza5Z-f",
    "X-GyJwza5Z-z",
}

opts := shape.ShapeOpts{
    HeaderNames:    headerNames,
    Proxy:      "",
    Url:            "https://www.target.com",
    ShapeUrl:       "https://carts.target.com/web_checkouts/v1/cart_items?field_groups=CART,CART_ITEMS,SUMMARY&key=9f36aeafbe60771e321a7cc95a78140772ab3e96",
    Identifier:     "cart_items",
    Method:         "POST",
    Body:           "{}",
    BlockResources: true, // * Will block extra unnecessary resources such as images and css
}

// * Create a ShapeHarvester, which immediately starts hijacking requests
harvester := shape.NewShapeHarvester(opts)

// * Harvest headers every 2 seconds, the Headers map will be directly updated on the struct
for {
    harvester.HarvestHeaders()
    log.Println(harvester.Headers["XGyJwza5Za"])
    time.Sleep(time.Second * time.Duration(2))
}

Core symbols most depended-on inside this repo

newBrowser
called by 1
utils.go
newPage
called by 1
utils.go
HarvestHeaders
called by 1
shape.go
initializeHijacking
called by 1
shape.go
NewShapeHarvester
called by 0
shape.go

Shape

Function 3
Method 2
Struct 2

Languages

Go100%

Modules by API surface

shape.go3 symbols
utils.go2 symbols
structs.go2 symbols

For agents

$ claude mcp add shape \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact