59
60async function feedbinUnreadEntries() {
61 const { result } = await (await fetch("https://kamalnrf-feedbinunreads.web.val.run")).json();
62 return result ?? [];
63}
12
13- `/push` will copy the contents from a list of vals specified in `config.json` and push them to a GitHub repo
14- `/deploy` is a GitHub webhook URL that will fetch contents from GitHub and update the code on Val Town
15
161. Fork this val
271. Add a `VAL_SECRET` env var to the val. Use this secret to sign the webhook POST request to the `/push` endpoint. Use this endpoint to commit vals from Val Town to your GitHub repo.
28
29### Example push to GitHub fetch
30
31You can use this example to POST to the `/push` endpoint to copy vals to GitHub.
46 const signature = await sign(body, secret);
47
48 const res = await fetch(url, {
49 method: "POST",
50 body,
89- [x] Monkey test
90- [x] Add setup instructions to readme
91- [x] Add example code for private webhook fetch
92- [x] Make val and repo public
93- [ ] Check modified date before export to GitHub??
22app.post("/deploy", verifyGitHubSignature(GITHUB_WEBHOOK_SECRET), deploy);
23
24export default app.fetch;
53 const handleClick = async (row, col) => {
54 try {
55 const response = await fetch("/api/board", {
56 method: "POST",
57 headers: {
275 const handleDownload = async (file) => {
276 try {
277 const response = await fetch(`/download?filename=${encodeURIComponent(file.name)}`, {
278 method: "GET",
279 });
92
93 // Send request for processing
94 const response = await fetch("/process", {
95 method: "POST",
96 headers: {
130 if (data.actionType === "use_tool" && data.tool) {
131 try {
132 const toolResponse = await fetch("/tool", {
133 method: "POST",
134 headers: {
155 // Get the other agent's analysis of the tool response
156 const otherAgent = activeAgent === "maverick" ? "oracle" : "maverick";
157 const analysisResponse = await fetch("/analyze", {
158 method: "POST",
159 headers: {
602 A user has requested information about: "${topic}"
603
604 Define a schema for this information topic and create a direct, action-oriented query to fetch detailed data.
605 Be decisive and focus on fast, effective results.
606
5async function servePublicFile(path: string): Promise<Response> {
6 const url = new URL("./public/" + path, import.meta.url);
7 const text = await (await fetch(url, {
8 headers: {
9 "User-Agent": "", // to transpile TS to JS
181
182 try {
183 const response = await fetch("/", {
184 method: "POST",
185 body: JSON.stringify({
1This val fetches unread articles from your FeedBin RSS subscriptions and uses Claude to generate a concise summaries of each article.
2
3Migrated from folder: RSSFeed/summarizeFeedbinEntries
14
15 // Step 1: Get unread entries ids
16 const unreadResponse = await fetch(`${BASE_URL}unread_entries.json`, {
17 method: "GET",
18 headers: headers,
19 });
20 if (!unreadResponse.ok) {
21 throw new Error(`Failed to fetch unread entries: ${unreadResponse.status}`);
22 }
23
28
29 // Step 2: Get entry details
30 const entriesResponse = await fetch(`${BASE_URL}entries.json?ids=${unreadEntryIds.slice(0, 100).join(",")}`, {
31 method: "GET",
32 headers: headers,
34
35 if (!entriesResponse.ok) {
36 throw new Error(`Failed to fetch entry details: ${entriesResponse.status}`);
37 }
38
41
42 // Step 3: Get feed information
43 const feedsResponse = await fetch(`${BASE_URL}subscriptions.json`, {
44 method: "GET",
45 headers: headers,
47
48 if (!feedsResponse.ok) {
49 throw new Error(`Failed to fetch feed information: ${feedsResponse.status}`);
50 }
51