ATProto, govcon and scream (scraping on the BEAM)

December 2, 2026

I've been toying with the idea of building a decentralized social network for government contracting. One of the main problems I've had in building Vindor (a small procurement service built on top of the wonderful, open source MakeGov) was reaching actual people that would use it. I also want to build something with the AT Protocol.

Feels backwards that all this data is publicly available through .gov APIs but the actual networks and groups are all closed. Why is this the case? I think it's mostly, if not entirely, greed-driven but I'm not going to say anything and call that out directly.

The first thing I'm going to be building is a better library for Gleam for scraping the web. I rely on scraping stuff pretty regularly to validate ideas. The first half of this post is building that tool, borrowing heavily from the Scrapling library that currently exists for Python that I've been using for everything. The second half is what it found: 77,948 posts and comments going back to 2007, where about one in eight of the ones I analyzed is a small contractor asking how to find a partner, a prime or a mentor. That's a network problem, and it's the kind of problem the AT Protocol is built for: a network nobody owns, where each business keeps its own identity and data, and anyone can build on top of it.

The program I end up writing with it is specific to what I'm doing, so it stays private, but scream ships a smaller, generic version of it as an example.

a name and dependencies

scream would be funny. scraping + BEAM. I checked hexdocs and it doesn't look like anything currently uses the package name in any of erlang, elixir or gleam, so I'm going to use it.

After quickly googling I come up with a short list of dependencies: htmgrrrl. That's it. I'm not going to wrap presentable_soup because the key features I want from Scrapling (similarity matching, sibling/parent navigation) would get abstracted away. presentable_soup optimizes too much for one-pass queries and doesn't give me the raw structure of the DOM, making it a separate set of functionality for navigating the DOM and I wind up with nothing I need out of the box.

registering on hex

I was too fast with naming and didn't realize I can't publish something to hex until it does something, so I'll add some code.

I need types for tree navigation in every direction. I replace the generated main with src/scream.gleam that has Document, Elements and we'll add a parse function.

pub opaque type Document {
  Document(nodes: Dict(Int, Node), root: Int)
}

pub opaque type Element {
  Element(document: Document, id: Int)
}
pub fn parse(html: String) -> Result(Document, Nil) {
  let start = Builder(nodes: dict.new(), open: [], next_id: 0)
  case htmgrrrl.sax(html, start, handle_event) {
    Ok(Builder(nodes:, ..)) ->
      case dict.has_key(nodes, 0) {
        True -> Ok(Document(nodes:, root: 0))
        False -> Error(Nil)
      }
    Error(Nil) -> Error(Nil)
  }
}

If you noticed earlier, we'll need a Node type too, so we'll go ahead and also include Node, Child and Builder.

So what is happening in parse?

htmgrrrl doesn't hand back a tree. It's a SAX parser. It reads the HTML from top to bottom and announces what it finds as it goes, like "an element opened", "here's some text" and "an element closed". Turning that stream of events into a tree is our job.

parse gives htmgrrrl three things: the HTML, a starting Builder and the function handle_event. htmgrrrl calls handle_event once for every event, passing in the Builder the previous call returned, and hands back the final Builder at the end. It's basically a fold over the document. parse then checks that something was actually built (node 0 exists) and wraps the nodes up in a Document.

The Builder tracks three things while we go:

  • nodes: the table of everything built so far
  • open: a stack of the elements we're currently inside, innermost on top
  • next_id: the id the next element will get

The next set of functions are sort of obvious if you imagine what's needed to build a DOM: handle_event, open_element, close_element, add_text and add_child.

This is the most important stuff, so we're good to publish our 0.1.0 package now.

I'm going with 0.1.0 since the API is going to change while I work on it over time. The only annoyance here is that gleam publish makes you type out "I am not using semantic versioning" to publish below 1.0. Feels like a fair thing to have to say but I know I'm going to get tired of typing it so I'll probably move to 1.0.0 once the API is decently fleshed out.

My brain couldn't decide whether we meant to use version 0.1.0 or 0.0.1 while I was running git tag commands, so I have git tags for both (only 0.1.0 made it to hex). Then I tagged the next release v0.1.2 but published it to hex as 0.2.0. I'm not going to untangle it; 0.2.0 it is, and I'll keep counting up from there.

scraping reddit and bluesky after some vibecoding

I put together a small program with scream that searches Bluesky with govcon terms and flags posts against a list of complaint keywords. To do this I had to extend scream a bit, adding CSS selectors, tree navigation, text, parse_xml for RSS/Atom, and a polite fetcher. In the initial, small batch of results of 156 posts all I got was marketing, event promos and political news, so Reddit will be better for getting any sort of real signal that I'm looking for.

For Reddit I'm still on Scrapling, because I'm too lazy to build out the bits I need in scream just yet (for one, its fetcher only does GET, and Reddit's login needs a POST). Reddit immediately blocked me, first when I tried requests that mimic Chrome and then even when I drove a real Chrome browser. So I need to use their official API, with OAuth and an app's client id and secret. That's fine. Fortunately, for Reddit I already have an account that is an app account, so I can register the app the API needs on it. My personal account defaulted to an app around a month ago after I'd been doing some manual outreach in the govcon subreddits. Apparently messaging forty-something people is bot behavior, and I didn't really care about my account becoming an "app" on the platform so I didn't do anything to prevent it happening.

This is the part that annoys me. Scraping has always been my cheap way of checking whether an idea is worth anything: grab a few thousand posts, grep through them, read what comes up. That loop gets more expensive every year, as every platform with an interesting conversation on it decides the conversation is theirs to sell. I said I wasn't going to call that out directly, so I won't.

Long term, scream is going to have to grow into something closer to Firecrawl: rendering JavaScript, turning pages into clean markdown, and coping with sites that only want to be read by a real browser. That's more than a weekend of work, though, and I don't need it to keep going.

the archive route

Then it clicked that I didn't need reddit.com at all, just Reddit's data. Arctic Shift keeps an archive of Reddit that you can search without logging in, 100 posts or comments at a time. Hacker News has a search API through Algolia, and Bluesky's public AppView has searchPosts. Every source I care about turned out to be a JSON API, and scream's polite fetcher plus gleam_json already handle those.

So instead of fighting Reddit I wrote ingest, a small Gleam project that depends on scream. A systemd timer runs it once a day. Each source keeps a cursor, so a run only fetches what's new, and each item is appended once to a monthly JSONL file per source, with usernames swapped for a short hash. That way I can count who posts most without keeping anyone's name around. ingest is specific to what I'm doing, so it lives in a private repo next to its data, and scream gets a generic example instead (more on that below).

scream picked up two small things along the way. The fetcher now honors x-ratelimit-reset when there's no Retry-After. And with_retry_on lets you treat other statuses like a 429, because Arctic Shift tells you to back off with a 422 that says "Timeout. Maybe slow down".

scream also gets me out of the endless loop of signing up for new services. I could just sign up for Firecrawl or TinyFish, but a key thing we can all get from using AI is building stuff for ourselves, and building my own lets me control all of the configuration. Sentiment from public posts is extremely validating whenever I'm working on something new, so it's worth getting it the cheap, controlled way instead of paying for a subscription I forget about and use every 6-8 weeks.

going back in time

The daily timer started in November 2025, which gave me 20,654 items. Arctic Shift goes back much further, so I added a backfill command with its own cursors, pointed it at 2005, and let it run for about an hour and a quarter at one request a second.

wherepostscommentsgoes back to
r/GovernmentContracting6,85958,0362013
r/govcon2,1157,4012010
Hacker News1431,4922007
Bluesky142142024

That's 77,948 items, almost four times what I started with, and none of it needed a login.

spending $0 of an $11 trial

I did try TinyFish in the end, but only the free parts. Search and fetch cost nothing on the hobby tier, so the $11 of trial credit went untouched. 93 searches across five angles (where contractors network, finding primes, paid tools, past attempts at a network, and complaints off Reddit) turned up 723 pages, and the ingest rubric found something in 547 of them.

The open web is the vendors' side of the conversation: consultants, chambers, podcasts, software comparison pages and event companies, all telling small contractors that relationships are the moat, and a lot of them selling access to those relationships.

One site looked like the exception: govcon.forum, an open Q&A forum that bans vendor pitches, with teaming threads that read like exactly what I was looking for. Its own metadata says it's run by RFPFinder, a vendor. Since launching on 2026-10-07 it has posted about 19 topics a day, timestamped a few seconds past the minute like a scheduler, and all 1,746 questions and answers come from 23 accounts, one of which wrote 224. I still collect it, labeled as vendor content, but I don't count it as anyone's real voice.

The sweep did give me 42 organizations that reach a lot of small contractors at once (APEX Accelerators, NCMA chapters, associations, podcasts and newsletters), each with the contact address it publishes on its own site.

asking claude how everyone feels

Regex finds leads, but it can't tell how anyone feels. So I exported 21,020 items worth a closer read (every post, plus comments that hit the rubric) and had Claude label them, using Haiku through Claude Code on the subscription I already pay for, so there was no API bill. Each label has a sentiment from -2 to 2, an emotion, a topic, who seems to be writing, the concrete pain, what they wish existed, and one quote copied word for word.

The instructions live in a LABELING.md. I ran a pilot batch and checked 20 labels by hand before doing the rest. A script marked 2,202 bare headlines neutral, govcon.forum was left out, and Claude labeled the remaining 15,643 Reddit, HN and Bluesky posts in batches of 150, five at a time, through a shell script that runs claude -p headless.

What came back:

  • Most of it is neutral. 61% neutral, 27% negative, 12% positive. That feels weak to state here, but most people aren't going to openly talk badly about the business they're involved in. Confused (2,338) and frustrated (2,049) far outnumber angry (465).
  • Small businesses are the unhappy ones. 46% of their posts are negative, against 13% for consultants and vendors.
  • Events are liked, access is resented. Networking events are 8% negative. Primes are 34%, consultants 36%, and incumbents and competition 46%.
  • 2025 was the worst year, at 35% negative (funding freezes, DOGE). Posts about getting paid are 50% negative.
what people asked forposts
a mentor, or "how do I get started"551
teaming or subcontracting partners489
cheaper tools and data450
connections and a network218

Partners and connections together come to about 700 posts. That's the problem I'm trying to solve, in their own words:

"It seems that the most primes aren't allowing new partners, or at least are not considering businesses they don't know." (r/GovernmentContracting)

"This is why contractors have entire positions for Business Development people, whose only job is to figure out what is going on, through archaic methods like conferences, buttering up feds, calling their friends, etc." (r/GovernmentContracting)

"all people in this space do is gatekeep and sell courses." (r/GovernmentContracting)

"Are there resources that can help companies in my position that feel as if we don't have a voice and feel left out due to lack of connections, etc?" (r/GovernmentContracting)

Any single label is a lead, not a fact. Across 15,000 posts, though, the pattern is hard to miss.

scream 0.3.0-rc.1

All of this pushed a release out of scream. 0.3.0-rc.1 ships the two fetcher changes from the Arctic Shift work, a changelog, and a LICENSE file to match what gleam.toml already claimed. It also adds examples/collector, the generic version of ingest: it collects Hacker News posts for a query, a little more each run, using the polite fetcher, scream.parse to turn HTML comments into text, and an append-only store with a cursor.

how fast is scream

I timed scream 0.3.0-rc.1 against Scrapling 0.5.1 on two saved pages: the Hacker News front page (32 KB) and a Wikipedia article (415 KB). Each case ran 100 times after a warm-up and was timed inside the program. The fetch case pulled from a server on my own machine, so no real site got hit 100 times.

pagecasescreamScrapling
Hacker Newsparse9.6 ms1.3 ms
Hacker Newsfetch, parse, select12.1 ms2.9 ms
Wikipediaparse99 ms9.2 ms
Wikipediafetch, parse, select113 ms12.8 ms

scream is 4 to 12 times slower. Both libraries find the same 30 and 57 links, so it's correct, just slow. On small pages most of the gap is the parser: htmgrrrl is pure Erlang, and Scrapling parses with lxml, which is C. On the big page scream's own tree building takes more than half the time and gets slower per element as the page grows, because every node updates one big immutable map. That's an obvious fix for a later version. For a scraper that waits a second between requests anyway, 100 ms of parsing isn't what's holding me back.

the tally

whatcount
posts and comments collected77,948
oldest post2007
TinyFish searches93
pages fetched with TinyFish723
TinyFish credit spent$0 of $11
partner orgs with a published contact42
seeded posts on the vendor-run forum1,746
accounts that wrote them23
posts labeled by Claude15,643
headlines marked neutral by a script2,202
quotes copied word for word3,575
items embedded and grouped into topics19,504 into 24
items about partners, subs and mentors2,601
scream vs Scrapling, parsing a 415 KB page99 ms vs 9 ms
scream tests (library, example, ingest)30, 3, 21
scream releases0.1.0, 0.2.0, 0.3.0-rc.1

the signal

The sentiment labels say how people feel. To see what they talk about, I embedded all 19,504 Reddit, HN and Bluesky items with a small open model (bge-small) on my laptop's CPU, so again there was no bill, and grouped them into 24 topics.

Three of those topics are the problem I want to solve: finding teaming partners and building relationships (974 items), working as a sub under a prime (809), and looking for a mentor or someone to ask, through APEX, LinkedIn or anyone else (818). Together that's 2,601 items, about one in eight. Their share went from 11.7% of everything in 2018–2023 to 14.1% in 2024–2026, and only about one in five of them is negative. People aren't complaining about this; they're asking for it.

The loudest topic is different: general venting about how the system works, at 61% negative. The fastest growing is recompetes and layoffs, which more than doubled its share between those two periods and is half negative.

That's the signal I was looking for: a lot of people asking the same question in public, with no good place to ask it.

Seeing this also makes me hopeful about an open social network, where individuals OWN their own data and can move freely from one provider to another. I'm still brainstorming my vindor-atproto project, which is more or less in a research phase and will stay that way for some time, but linking a business's UEI (the ID SAM.gov gives every registered business) to a DID (the ID behind every AT Protocol account) is something that can already be done, and that UEI-to-DID linker is what I'm building next. That level of visibility would be basic, but if you're able to inject people (or they insert themselves, since it's all open source and meant to be owned by individual businesses) and they can see each other right away, there's immediate, real value.

#govcon #atproto #opendata