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/?q=api&page=97&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 20764 results for "api"(7089ms)

rust-nyc-discord-bot

rust-nyc-discord-botApp.tsx1 match

@colelโ€ขUpdated 1 week ago
27
28 try {
29 const response = await fetch("/api/submissions", {
30 method: "POST",
31 headers: {
rust-nyc-discord-bot

rust-nyc-discord-botREADME.md8 matches

@colelโ€ขUpdated 1 week ago
22```
23โ”œโ”€โ”€ backend/
24โ”‚ โ””โ”€โ”€ index.ts # Main API server with Hono
25โ”œโ”€โ”€ frontend/
26โ”‚ โ”œโ”€โ”€ index.html # Main HTML template
72```
73
74## API Endpoints
75
76- `POST /api/submissions` - Submit a new talk proposal
77- `GET /api/submissions` - Get all submissions (admin)
78
79## Discord Integration Status
88**Comprehensive Logging**: The system includes detailed logging throughout the Discord integration process:
89- ๐Ÿ” Environment variable checks on startup
90- ๐ŸŽฏ API request tracking with submission details
91- ๐Ÿ”ง Discord channel creation with API responses
92- ๐Ÿ”— Invite link generation with full details
93- ๐Ÿ“ข Organizer notifications with message content
97**Fallback behavior**: If Discord credentials are not provided, the system will use placeholder values and log what would have been done, allowing the form to still function for testing.
98
99**Debugging**: Use the requests tool to view detailed logs of each submission, including all Discord API interactions and any errors that occur.
100
101## Usage
108## Tech Stack
109
110- **Backend**: Hono (API framework)
111- **Frontend**: React 18.2.0 with TypeScript
112- **Database**: SQLite
56
57 if (!response.ok) {
58 throw new Error(`Reddit API error: ${response.status} ${response.statusText}`);
59 }
60

reddit-checkerreddit-api-monitor.ts12 matches

@sunnyatlightswitchโ€ขUpdated 1 week ago
1/**
2 * Reddit API Monitor - Monitors subreddits using Reddit's official API
3 * This script checks the Lovable subreddit for posts containing "auth" and related terms
4 */
64};
65
66// Reddit API credentials
67const REDDIT_CLIENT_SECRET = 'rX_YGngVjaxRA3Y0F3STl2cuEmgHkQ';
68const REDDIT_CLIENT_ID = '151sZ8h5TaHVZGZZn0rOhA';
72
73/**
74 * Gets an access token from Reddit API
75 */
76async function getRedditAccessToken(): Promise<string> {
85 const auth = btoa(`${REDDIT_CLIENT_ID}:${REDDIT_CLIENT_SECRET}`);
86
87 const response = await fetch('https://www.reddit.com/api/v1/access_token', {
88 method: 'POST',
89 headers: {
115
116/**
117 * Fetches recent posts from a subreddit using Reddit API
118 */
119async function fetchSubredditPosts(subreddit: string, limit: number = 25): Promise<RedditPost[]> {
130
131 if (!response.ok) {
132 throw new Error(`Reddit API error: ${response.status} ${response.statusText}`);
133 }
134
230async function getLastChecked(): Promise<number> {
231 try {
232 const data = await blob.getJSON("reddit_api_monitor_last_checked");
233 return data?.timestamp || 0;
234 } catch {
241 */
242async function saveLastChecked(timestamp: number): Promise<void> {
243 await blob.setJSON("reddit_api_monitor_last_checked", { timestamp });
244}
245
248 */
249export default async function() {
250 console.log(`๐Ÿ” Starting Reddit API monitor for ${CONFIG.subreddits.length} subreddits`);
251 console.log(`๐Ÿ“‹ Subreddits: ${CONFIG.subreddits.map(s => `r/${s}`).join(', ')}`);
252 console.log(`๐Ÿ“‹ Keywords: ${CONFIG.keywords.join(', ')}`);
320 }
321
322 console.log(`โœ… Reddit API monitor completed successfully`);
323
324 return {
332
333 } catch (error) {
334 console.error('โŒ Reddit API monitor failed:', error);
335
336 // Send error notification to Slack
346 color: "danger",
347 title: "Monitor Failed",
348 text: `Reddit API monitor encountered an error: ${error.message}`,
349 footer: "Reddit Monitor",
350 ts: Math.floor(Date.now() / 1000)

projects_cms_handlermain.tsx3 matches

@saCDโ€ขUpdated 1 week ago
58 // Fetch projects from the CMS
59 const projectsCMS = async (): Promise<any> => {
60 const API_URL = "https://cd25-projects-cms.sa-60b.workers.dev/api/cms_projects";
61 debugLog("Fetching projects from CMS:", API_URL);
62 try {
63 const response = await fetch(API_URL, {
64 method: "GET",
65 headers: {

force-pushApp.tsx1 match

@lightweightโ€ขUpdated 1 week ago
119 <div className="flex flex-row space-x-2">
120 <div>
121 Val Town API key with val:write:
122 </div>
123 <input

force-pushpush.ts1 match

@lightweightโ€ขUpdated 1 week ago
30 error: true,
31 message:
32 "Failed to create force-push-temp branch, likely because you don't have the right permission in you api key or the branch already exists. Delete it before trying again.",
33 stack: e.stack,
34 };

stock_forecastindex.ts2 matches

@sultanoloyedeโ€ขUpdated 1 week ago
13app.get("/shared/*", c => serveFile(c.req.path, import.meta.url));
14
15// API endpoint to fetch probability data
16app.get("/api/probability", async (c) => {
17 try {
18 const response = await fetch("https://37ce-137-122-64-213.ngrok-free.app/predict", {

toolsfetch-ip-address.tsx1 match

@chadparkerโ€ขUpdated 1 week ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3let result = await fetch("https://api64.ipify.org?format=json");
4let json = await result.json();
5console.log(json.ip);

reactHonoStarterindex.ts2 matches

@meakrโ€ขUpdated 1 week ago
12app.get("/frontend/**/*", c => serveFile(c.req.path, import.meta.url));
13
14// Add your API routes here
15// app.get("/api/data", c => c.json({ hello: "world" }));
16
17// Unwrap and rethrow Hono errors as the original error

claude-api1 file match

@ziyanwouldโ€ขUpdated 3 days ago

api-workshop

@danarddanielsjrโ€ขUpdated 5 days ago
replicate
Run AI with an API
fiberplane
Purveyors of Hono tooling, API Playground enthusiasts, and creators of ๐Ÿชฟ HONC ๐Ÿชฟ (https://honc.dev)