MCPcopy Create free account
hub / github.com/Swizec/article-threader / createTwitterThread

Function createTwitterThread

components/ThreadMaker.tsx:5–19  ·  view source on GitHub ↗
(vars: { url: string; tweetCount: number })

Source from the content-addressed store, hash-verified

3import { Box, Button, Input, Label, Spinner } from "theme-ui";
4
5async function createTwitterThread(vars: { url: string; tweetCount: number }) {
6 const res = await fetch("/api/createTwitterThread", {
7 method: "POST",
8 headers: {
9 "Content-Type": "application/json",
10 },
11 body: JSON.stringify(vars),
12 });
13
14 if (!res.ok) {
15 throw new Error("Failed to createTwitterThread");
16 }
17
18 return res.text();
19}
20
21const Thread = (props: { text: string }) => {
22 const text = props.text.replaceAll(/(\n)+/g, "\n\n");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected