• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
cyberskunk

cyberskunk

Popup-from-html

Public
Like
Popup-from-html
Home
Code
2
README.md
H
index.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
index.ts
https://cyberskunk--4d6f2d10354811f0bae59e149126039e.web.val.run
README.md

Technical Rules Fetcher

This Val Town project provides an HTTP endpoint that fetches and displays specific sections from a technical rules document based on their HTML IDs.

Features

  • Fetches sections from the technical rules document at https://cyberskunk.xyz/q-n-a/rules/Technical_rules.html
  • Allows referencing specific rules by their ID (e.g., t66)
  • Lists all available rule IDs for easy discovery
  • Caches the document to reduce load on the source server
  • Provides a simple web interface for accessing rules
  • Offers JSON API endpoints for programmatic access

Usage

Quick Links

  • Get All Articles - View a grid of all available rule IDs
  • Open Original Document - View the source technical rules document

HTML Endpoints

To access a specific rule in HTML format, use the following URL format:

/rule/{ruleId}

For example, to access rule t66:

/rule/t66

To see a list of all available rules in HTML format:

/rules

This will display a grid of all rule IDs that you can click to view.

JSON API Endpoints

For programmatic access, the following JSON endpoints are available:

Get a specific rule as JSON:

/api/rule/{ruleId}

Example response:

{ "id": "t66", "originalQuery": "t66", "content": "<div id=\"t66\">...</div>..." }

Get all rule IDs as JSON:

/api/rules

Example response:

{ "rules": ["t1", "t2", "t3", ...] }

Home Page

The home page (/) provides usage instructions and links to example rules.

Implementation Details

  • Uses cheerio for HTML parsing on the server side
  • Implements caching to avoid fetching the document on every request
  • Extracts and sorts rule IDs for easy navigation
  • Provides formatted HTML output for better readability
  • Offers JSON API endpoints with CORS support for cross-origin requests

Future Improvements

Potential enhancements for this project:

  1. Add a search functionality to find rules by keywords
  2. Implement a more detailed table of contents showing rule titles
  3. Add support for fetching multiple rules at once
  4. Improve styling and mobile responsiveness
  5. Add a feature to extract and display rule titles alongside IDs
HTTP
  • index.ts
    cyberskunk--4d…9e.web.val.run
Code
README.md
H
index.ts
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.