Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/image-url.jpg%20%22Image%20title%22?q=api&page=2&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=api

Returns an array of strings in format "username" or "username/projectName"

Found 21177 results for "api"(4918ms)

ContextualLitedefinitions.ts5 matches

@c15rโ€ขUpdated 9 hours ago
366 {
367 name: "openai-chat-completion",
368 description: "Create a chat completion using OpenAI's API via Val Town's OpenAI integration",
369 inputSchema: {
370 type: "object",
501 {
502 name: "admin-read-val-file",
503 description: "Read a source code file from the project using Val Town API (admin only)",
504 inputSchema: {
505 type: "object",
515 {
516 name: "admin-write-val-file",
517 description: "Write/update a source code file in the project using Val Town API (admin only)",
518 inputSchema: {
519 type: "object",
533 {
534 name: "admin-list-val-files",
535 description: "List all files in the project directory structure using Val Town API (admin only)",
536 inputSchema: {
537 type: "object",
552 {
553 name: "admin-project-info",
554 description: "Get project information and structure overview using Val Town API (admin only)",
555 inputSchema: {
556 type: "object",

rust-nyc-event-signinAGENT.md1 match

@colelโ€ขUpdated 9 hours ago
8## Architecture
9- **Val Town Project**: Deno-based event check-in system with React frontend
10- **Backend**: Hono API server (backend/index.ts) handling event management and check-ins
11- **Frontend**: React 18.2.0 with TypeScript (frontend/index.tsx, components/)
12- **Database**: SQLite with events_4, attendees_4, checkins_4, and sessions_2 tables

rust-nyc-event-signinindex.ts44 matches

@colelโ€ขUpdated 9 hours ago
179}
180
181// API Routes
182
183// Create new event
184app.post("/api/events", async c => {
185 console.log(`๐ŸŽฏ [API] New event creation request`);
186
187 try {
189 const { name, password, location, csvContent } = body;
190
191 console.log(`๐Ÿ“‹ [API] Event details: "${name}", location: "${location || 'N/A'}"`);
192
193 if (!name || !password || !csvContent) {
205 const passwordHash = hashPassword(password);
206 const eventId = Math.floor(Date.now() / 1000); // Unix timestamp in seconds
207 console.log(`๐Ÿ“‹ [API] Creating event with ID: ${eventId}, name: "${name}", location: "${location || 'N/A'}"`);
208
209 try {
212 [eventId, name, passwordHash, location || null]
213 );
214 console.log(`โœ… [API] Event successfully inserted into database with ID: ${eventId}`);
215 } catch (error) {
216 console.error(`๐Ÿ’ฅ [API] Failed to insert event:`, error);
217 throw error;
218 }
221 const verifyEventResult = await sqlite.execute(`SELECT id, name FROM ${TABLES.EVENTS} WHERE id = ?`, [eventId]);
222 const verifyEvent = verifyEventResult.rows || verifyEventResult;
223 console.log(`๐Ÿ” [API] Event verification: found ${verifyEvent.length} events with ID ${eventId}`);
224 if (verifyEvent.length > 0) {
225 console.log(`๐Ÿ” [API] Event details: ${JSON.stringify(verifyEvent[0])}`);
226 }
227
228 // Insert attendees
229 console.log(`๐Ÿ“‹ [API] Starting to insert ${attendees.length} attendees...`);
230 let insertedCount = 0;
231 for (const attendee of attendees) {
236 );
237 insertedCount++;
238 console.log(`๐Ÿ‘ค [API] Inserted attendee ${insertedCount}/${attendees.length}: "${attendee.name}" (external_id: ${attendee.external_id || 'N/A'})`);
239 } catch (error) {
240 console.error(`๐Ÿ’ฅ [API] Failed to insert attendee "${attendee.name}":`, error);
241 throw error;
242 }
247 const verifyAttendees = verifyAttendeesResult.rows || verifyAttendeesResult;
248 const actualAttendeeCount = Number(verifyAttendees[0]?.count || 0);
249 console.log(`๐Ÿ” [API] Attendee verification: expected ${attendees.length}, found ${actualAttendeeCount} in database`);
250
251 console.log(`โœ… [API] Successfully added ${insertedCount} attendees to event ${eventId}`);
252
253 return c.json({
259
260 } catch (error) {
261 console.error(`๐Ÿ’ฅ [API] Error creating event:`, error);
262 return c.json({ error: "Internal server error" }, 500);
263 }
265
266// Get basic event info (public, no auth required)
267app.get("/api/:eventId", async c => {
268 const eventId = parseInt(c.req.param("eventId"));
269 console.log(`๐Ÿ“‹ [API] Fetching basic event details for event ${eventId}`);
270
271 try {
277
278 if (event.length === 0) {
279 console.log(`โŒ [API] Event ${eventId} not found`);
280 return c.json({ error: "Event not found" }, 404);
281 }
297 const checkedInCount = Number(checkedInCountRows[0]?.count || 0);
298
299 console.log(`๐Ÿ“‹ [API] Event ${eventId} found: ${attendeeCount} attendees, ${checkedInCount} checked in`);
300
301 return c.json({
311
312 } catch (error) {
313 console.error(`๐Ÿ’ฅ [API] Error fetching event details:`, error);
314 return c.json({ error: "Internal server error" }, 500);
315 }
317
318// Get attendee list for sign-in (names only, no sensitive info)
319app.get("/api/:eventId/attendees", async c => {
320 const eventId = parseInt(c.req.param("eventId"));
321 console.log(`๐Ÿ“‹ [API] Fetching attendees for event ${eventId}`);
322
323 try {
324 // First check if event exists
325 console.log(`๐Ÿ” [API] Checking if event ${eventId} exists in table ${TABLES.EVENTS}`);
326 const eventCheckResult = await sqlite.execute(`
327 SELECT id FROM ${TABLES.EVENTS} WHERE id = ?
329
330 const eventCheck = eventCheckResult.rows || eventCheckResult;
331 console.log(`๐Ÿ” [API] Event check result: found ${eventCheck.length} events with ID ${eventId}`);
332 if (eventCheck.length === 0) {
333 console.log(`โŒ [API] Event ${eventId} not found`);
334 return c.json({ error: "Event not found" }, 404);
335 }
336
337 // Get attendees with check-in status
338 console.log(`๐Ÿ” [API] Querying attendees from table ${TABLES.ATTENDEES} for event ${eventId}`);
339 const attendeesResult = await sqlite.execute(`
340 SELECT a.id, a.name,
347
348 const attendees = attendeesResult.rows || attendeesResult;
349 console.log(`๐Ÿ“‹ [API] Found ${attendees.length} attendees for event ${eventId}`);
350
351 // Log first few attendees for debugging
352 if (attendees.length > 0) {
353 console.log(`๐Ÿ” [API] First few attendees:`, attendees.slice(0, 3).map(a => ({ id: a.id, name: a.name, checked_in: a.checked_in })));
354 }
355
362 };
363
364 console.log(`๐Ÿ“‹ [API] Returning ${result.attendees.length} attendees to client`);
365 return c.json(result);
366
367 } catch (error) {
368 console.error(`๐Ÿ’ฅ [API] Error fetching attendees for event ${eventId}:`, error);
369 console.error(`๐Ÿ’ฅ [API] Error stack:`, error.stack);
370 return c.json({ error: "Internal server error" }, 500);
371 }
373
374// Sign in to event
375app.post("/api/:eventId/signin", async c => {
376 const eventId = parseInt(c.req.param("eventId"));
377
403 const existingCheckIn = existingCheckInResult.rows || existingCheckInResult;
404 if (existingCheckIn.length > 0) {
405 console.log(`โš ๏ธ [API] Attendee ${attendee[0].name} already signed in`);
406 // TODO: Consider security implications of multiple sign-in attempts
407 // For now, we'll allow it but flag it
420 );
421
422 console.log(`โœ… [API] ${attendee[0].name} signed in to event ${eventId}`);
423
424 return c.json({
429
430 } catch (error) {
431 console.error(`๐Ÿ’ฅ [API] Error during sign-in:`, error);
432 return c.json({ error: "Internal server error" }, 500);
433 }
435
436// Authentication endpoint - login with password and create session
437app.post("/api/:eventId/auth", async c => {
438 const eventId = parseInt(c.req.param("eventId"));
439
471
472 } catch (error) {
473 console.error(`๐Ÿ’ฅ [API] Error during authentication:`, error);
474 return c.json({ error: "Internal server error" }, 500);
475 }
477
478// Logout endpoint
479app.post("/api/:eventId/logout", async c => {
480 clearSessionCookie(c);
481 return c.json({ success: true });
483
484// Get event details (session protected)
485app.get("/api/:eventId/details", authMiddleware, async c => {
486 const eventId = parseInt(c.req.param("eventId"));
487
531
532 } catch (error) {
533 console.error(`๐Ÿ’ฅ [API] Error fetching event details:`, error);
534 return c.json({ error: "Internal server error" }, 500);
535 }
537
538// Get analytics (session protected)
539app.get("/api/:eventId/analytics", authMiddleware, async c => {
540 const eventId = parseInt(c.req.param("eventId"));
541
590
591 } catch (error) {
592 console.error(`๐Ÿ’ฅ [API] Error fetching analytics:`, error);
593 return c.json({ error: "Internal server error" }, 500);
594 }
596
597// Export check-in data as CSV (session protected)
598app.get("/api/:eventId/export", authMiddleware, async c => {
599 const eventId = parseInt(c.req.param("eventId"));
600
649
650 } catch (error) {
651 console.error(`๐Ÿ’ฅ [API] Error exporting data:`, error);
652 return c.json({ error: "Internal server error" }, 500);
653 }

postherousindex.ts6 matches

@paulkinlanโ€ขUpdated 9 hours ago
454});
455
456// API: Get all posts
457app.get("/api/posts", async c => {
458 try {
459 await ensureDbInitialized();
469});
470
471// API: Get single post
472app.get("/api/posts/:slug", async c => {
473 try {
474 await ensureDbInitialized();
490});
491
492// API: Get activity counts for a post
493app.get("/api/posts/:slug/activities", async c => {
494 try {
495 await ensureDbInitialized();

rust-nyc-event-signinEventManagement.tsx8 matches

@colelโ€ขUpdated 9 hours ago
30 const checkAuthentication = async () => {
31 try {
32 const response = await fetch(`/api/${eventId}/details`);
33 if (response.ok) {
34 setIsAuthenticated(true);
41 const authenticate = async () => {
42 try {
43 const response = await fetch(`/api/${eventId}/auth`, {
44 method: 'POST',
45 headers: { 'Content-Type': 'application/json' },
62 setLoading(true);
63 const [detailsRes, attendeesRes, analyticsRes] = await Promise.all([
64 fetch(`/api/${eventId}/details`),
65 fetch(`/api/${eventId}/attendees`),
66 fetch(`/api/${eventId}/analytics`)
67 ]);
68
89 const exportCSV = async () => {
90 try {
91 const response = await fetch(`/api/${eventId}/export`);
92 if (!response.ok) throw new Error('Failed to export data');
93
116 const logout = async () => {
117 try {
118 await fetch(`/api/${eventId}/logout`, { method: 'POST' });
119 setIsAuthenticated(false);
120 } catch (err) {
231 key={tab}
232 onClick={() => setActiveTab(tab)}
233 className={`py-2 px-1 border-b-2 font-medium text-sm capitalize ${
234 activeTab === tab
235 ? 'border-[var(--accent-primary)] text-[var(--accent-primary)]'

rust-nyc-event-signinEventSignIn.tsx2 matches

@colelโ€ขUpdated 9 hours ago
32 const loadAttendees = async () => {
33 try {
34 const response = await fetch(`/api/${eventId}/attendees`);
35 if (!response.ok) throw new Error('Failed to load attendees');
36 const data: AttendeeListResponse = await response.json();
48
49 try {
50 const response = await fetch(`/api/${eventId}/signin`, {
51 method: 'POST',
52 headers: { 'Content-Type': 'application/json' },

rust-nyc-event-signinEventCreation.tsx1 match

@colelโ€ขUpdated 9 hours ago
36
37 try {
38 const response = await fetch('/api/events', {
39 method: 'POST',
40 headers: {
11- [ ] Default to `false` for new events
12
13### API Changes
14- [ ] Update `CreateEventRequest` type to include `allowOnsiteRegistration?: boolean`
15- [ ] Modify POST `/api/events` endpoint to accept and store new field
16- [ ] Update Event interface to include `allow_onsite_registration: boolean`
17
18### Registration Form
19- [ ] Add GET `/api/:eventId/signup` endpoint returning event name and registration status
20- [ ] Add POST `/api/:eventId/signup` endpoint accepting `{ name: string }`
21- [ ] Only show registration form if `allow_onsite_registration` is true
22- [ ] Create new attendee record with `external_id` set to "onsite-{timestamp}"

rust-nyc-event-signinREADME.md10 matches

@colelโ€ขUpdated 9 hours ago
23```
24โ”œโ”€โ”€ backend/
25โ”‚ โ””โ”€โ”€ index.ts # Main API server with Hono
26โ”œโ”€โ”€ frontend/
27โ”‚ โ”œโ”€โ”€ index.html # Main HTML template
41### Environment Variables
42
43No external API keys required for basic functionality. Optional Discord integration available for future features.
44
45### Database
77```
78
79## API Endpoints
80
81- `POST /api/events` - Create a new event
82- `GET /api/:eventId` - Get event details (password protected)
83- `POST /api/:eventId/signin` - Sign in to an event
84- `GET /api/:eventId/attendees` - Get attendee list for sign-in (names only)
85- `GET /api/:eventId/analytics` - Get check-in analytics (password protected)
86- `GET /api/:eventId/export` - Export check-in data as CSV (password protected)
87
88## Routes
124## Tech Stack
125
126- **Backend**: Hono (API framework)
127- **Frontend**: React 18.2.0 with TypeScript
128- **Database**: SQLite

postherousACTIVITYPUB.md1 match

@paulkinlanโ€ขUpdated 9 hours ago
188- [WebFinger Specification](https://tools.ietf.org/html/rfc7033)
189- [ActivityStreams Vocabulary](https://www.w3.org/TR/activitystreams-vocabulary/)
190- [Mastodon API Documentation](https://docs.joinmastodon.org/spec/activitypub/)
191
192---

github-api8 file matches

@cricks_unmixed4uโ€ขUpdated 9 hours ago
Very incomplete collection of useful GitHub API adapters

myAPiKey

@Kix111โ€ขUpdated 12 hours ago
papimark21
codingpapi