package fa import ( "encoding/json" "strings" "github.com/PuerkitoBio/goquery" ) // listingJSONEntry is one row of FA's embedded js-submissionData blob — // a JSON dictionary every listing page emits with stable metadata for // each visible submission. The blob is keyed by submission ID (string) // and survives most HTML reshuffles because it's consumed by FA's own // front-end JS. // // Not every field appears on every page; description is sometimes truncated // to ~500 chars with a trailing "…". We use this purely as a hinting // source the HTML figure scrape remains authoritative for fields the // JSON doesn't carry (ID, rating, thumbnail). type listingJSONEntry struct { Title string `json:"title"` Description string `json:"description"` // BBCode source (may be truncated) Username string `json:"username"` // display name with original casing Lower string `json:"lower"` // URL-safe lowercase login AvatarMtime string `json:"avatar_mtime"` } // listingJSONMap is the parsed js-submissionData blob: SubmissionID → entry. type listingJSONMap map[SubmissionID]listingJSONEntry // readListingJSON pulls and parses the