{"id":30461536,"url":"https://github.com/bpbecker/bb","last_synced_at":"2026-03-02T22:32:49.314Z","repository":{"id":19158414,"uuid":"22389887","full_name":"bpbecker/bb","owner":"bpbecker","description":"Brian Becker's Sandbox","archived":false,"fork":false,"pushed_at":"2025-08-14T20:32:04.000Z","size":1651,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-08-24T00:29:46.656Z","etag":null,"topics":["apl","dyalog","dyalog-apl","dyalog-library"],"latest_commit_sha":null,"homepage":"","language":"APL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bpbecker.png","metadata":{"files":{"readme":"README.md","changelog":"changes.dyalog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-07-29T18:01:37.000Z","updated_at":"2025-08-14T20:32:09.000Z","dependencies_parsed_at":"2025-08-14T22:24:39.472Z","dependency_job_id":"27097029-2e26-4030-aca1-8b7224948b8e","html_url":"https://github.com/bpbecker/bb","commit_stats":null,"previous_names":["bpbecker/bb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bpbecker/bb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpbecker%2Fbb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpbecker%2Fbb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpbecker%2Fbb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpbecker%2Fbb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bpbecker","download_url":"https://codeload.github.com/bpbecker/bb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpbecker%2Fbb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29332713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T06:13:03.264Z","status":"ssl_error","status_checked_at":"2026-02-11T06:12:55.843Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apl","dyalog","dyalog-apl","dyalog-library"],"created_at":"2025-08-23T21:35:53.208Z","updated_at":"2026-02-11T12:04:02.660Z","avatar_url":"https://github.com/bpbecker.png","language":"APL","funding_links":[],"categories":[],"sub_categories":[],"readme":"bb\n==\n\nBrian's Playground\n\nThis repository contains stuff I've tinkered with, some of it may be interesting, some of it may be incomplete.  The contents are provided \"as is\".\n\n----------\n\n## `xhtml.dyalog` namespace\n\nContains utilities to:\n- convert HTML to XHTML which is subsequently able to be parsed by `⎕XML`\n- search and extract elements from the result of `⎕XML`\n\n### `HTMLtoXHTML`\n`xhtml ← xhtml.HTMLtoXHTML html`\n`html` is a character vector containing HTML\n`xhtml` is a matrix form of the XHTML\n\n`HTMLtoXHTML` assumes that the HTML is reasonably formed (e.g. open tags have corresponding closing tags). It handles most, but probably not all, HTMLisms of some elements not requiring a closing tag.\n\n### `Xfind`\n`boolvec ← xml xhtml.Xfind spec`\n`xml` is an XML matrix (could be XHTML, but doesn't have to be)\n`spec` is a delimited-string search specification (first character is the delimiter) in the form `/levels/elements/content/attribute/value` where:\n- `levels`, if non-empty, specifies the level(s) to consider in the search.  For example:\n    - `3` specifies level 3 elements only, `3-` level 3 and lower (to 0), `3+` level 3 and higher, `3-5` levels 3 through 5\n- `elements` is a space-delimited list of elements to select\n- `content` is case-insensitive content to search for using `⍷`\n- `attribute` is a case-sensitive attribute name to exactly search for\n- `value` is a case-insensitive attribute value to search for using `⍷`, if no `attribute` is specified, all attributes will be searched.\n\n`boolvec` is a Boolean vector marking matching elements\n\nExamples:\n```\n\n      xml xhtml.Xfind '//table//class/results' ⍝ find all \u003ctable\u003e elements with a class attribute containing 'results'\n\n      xml xhtml.Xfind '/2////foobar' ⍝ find all level 2 elements with any attribute containing 'foobar'\n\n      xml xhtml.Xfind '/3+/th td/bloof' ⍝ find all level 3 or higher \u003cth\u003e or \u003ctd\u003e elements containing 'bloof' \n```\n### `Xsel`\n`elements ← xml Xsel boolvec`\n`xml` is an XML matrix (could be XHTML, but doesn't have to be)\n`boolvec` is a Boolean vector with as many elements as rows in `xml`\n`elements` is a nested vector of elements marked by `boolvec` and their descendants\n\n### Typical Use Case\nIn general, you'll convert some HTML to XHTML and then search for and extract element of interest to you.  For example:\n\n```\n\n      resp ← HttpCommand.Get 'someurl.com/somefile.html' ⍝ make a request \n      'request failed' ⎕SIGNAL (0 200≢resp.(rc HttpStatus))/777 ⍝ check that it succeeded\n      h ← resp.Data ⍝ grab the response data\n      x ← xhtml.HTMLtoXHTML h ⍝ convert to XHTML\n      mytables ← x xhtml.Xsel x xhtml.Xfind '//table//class/results' ⍝ extract all the \u003ctable\u003e elements with a class attribute containing \"results\"\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbpbecker%2Fbb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbpbecker%2Fbb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbpbecker%2Fbb/lists"}