Skip to content

Instantly share code, notes, and snippets.

@alexellis
Last active January 20, 2026 16:14
Show Gist options
  • Select an option

  • Save alexellis/6bb11f6c4eaee90596d238cf6c16ed55 to your computer and use it in GitHub Desktop.

Select an option

Save alexellis/6bb11f6c4eaee90596d238cf6c16ed55 to your computer and use it in GitHub Desktop.
Testing 64k context window with Claude/Ollama integration
// Written by Claude / Qwen-Coder 30b
package main
import (
"fmt"
"io"
"net/http"
"regexp"
)
func main() {
// Fetch the pricing page
resp, err := http.Get("https://slicervm.com/pricing")
if err != nil {
fmt.Printf("Error fetching page: %v\n", err)
return
}
defer resp.Body.Close()
// Read the entire body
body, err := io.ReadAll(resp.Body)
if err != nil {
fmt.Printf("Error reading body: %v\n", err)
return
}
// Convert to string
content := string(body)
// Extract price values from the specific HTML structure
// Looking for patterns like <div class="text-4xl font-bold text-primary mb-2">$25
re := regexp.MustCompile(`<div[^>]*>\$([0-9]+)`)
matches := re.FindAllStringSubmatch(content, -1)
// Extract unique prices and sort them
var prices []int
seen := make(map[int]bool)
for _, match := range matches {
if len(match) > 1 {
price := 0
_, err := fmt.Sscanf(match[1], "%d", &price)
if err == nil && price > 0 {
if !seen[price] {
prices = append(prices, price)
seen[price] = true
}
}
}
}
// Sort prices in ascending order
for i := 0; i < len(prices)-1; i++ {
for j := i + 1; j < len(prices); j++ {
if prices[i] > prices[j] {
prices[i], prices[j] = prices[j], prices[i]
}
}
}
// Print results
fmt.Println("SlicerVM Pricing Information")
fmt.Println("============================")
if len(prices) >= 2 {
// Assuming the cheaper one is home edition and the more expensive is commercial
homePrice := prices[0]
commercialPrice := prices[1]
fmt.Printf("\nHome Edition License (2x):\n")
fmt.Printf("Monthly: $%d\n", homePrice * 2)
fmt.Printf("Annual: $%d\n", homePrice*2*12)
fmt.Printf("\nCommercial License (5x):\n")
fmt.Printf("Monthly: $%d\n", commercialPrice * 5)
fmt.Printf("Annual: $%d\n", commercialPrice*5*12)
fmt.Printf("\nBreakdown:\n")
fmt.Printf("- Home Edition: $%d/month ($%d/year) for 2 licenses\n", homePrice, homePrice*12)
fmt.Printf("- Commercial: $%d/month ($%d/year) for 5 licenses\n", commercialPrice, commercialPrice*12)
} else {
fmt.Println("Could not extract two distinct prices from the page.")
fmt.Println("Found prices:", prices)
}
}

This final prompt ended up having to be so specific, even giving the implementation detail as the model was so dumb.

Prompt:

We're buying licenses from slicervm.com for their microVM product.

Find out the pricing for 2x home edition licenses and 5x commercial ones the page
is https://slicervm.com/pricing

Parse the HTML by looking between HTML tags only, where you see $ and some numbers
after, strictly such as "$100" but not "$FA" and do not consider javascript.

If you can't work out which is which, home edition is cheaper. There should
only be two prices on the page.

Print the results as monthly and annual costs, with a full breakdown.

Write a Go program to produce the output live so we can detect changes.

Under no circumstance guess, do not fall back to values you come up with on your own.
You have no reason to conduct a web search for slicer pricing, it's directly in the HTML.

If I were you, I'd use a HTML parsing library, then iterate every tag, look 
at its innerHTML/text and run your regex against each.

Didn't work as a one-shot, then needed:

That's close, however those prices are for 1x license, and you were asked to multiply them.
Update the values.

Result:

ubuntu@lab-1:~$ go run slicervm_pricing.go 
SlicerVM Pricing Information
============================

Home Edition License (2x):
Monthly: $50
Annual:  $600

Commercial License (5x):
Monthly: $1250
Annual:  $15000

Breakdown:
- Home Edition: $25/month ($300/year) for 2 licenses
- Commercial:   $250/month ($3000/year) for 5 licenses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment