daily-advice-app1 file match
Random advice app using Advice Slip API
You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$%7Burl%7D?q=api&page=3&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 14814 results for "api"(1671ms)
24<select id="endpoint" class="w-full p-2 border border-gray-300 rounded-md">
25<option value="">Root (will show 404)</option>
26<option value="api" selected>api (main application)</option>
27<option value="health">health</option>
28<option value="status">status</option>
76if (format) params.append('format', format);
77
78const response = await fetch('/api?' + params.toString());
79
80if (format === 'raw') {
104}
105
106// If it's a request to /api, proxy to the timekeeper reader
107if (url.pathname === '/api') {
108const endpoint = url.searchParams.get('endpoint') || '';
109const format = url.searchParams.get('format') || 'json';
125// Extract useful information from the HTML if it's the main app
126let extractedInfo = null;
127if (endpoint === 'api' && data.includes('Timekeeper')) {
128const titleMatch = data.match(/<title>(.*?)<\/title>/);
129const descriptionMatch = data.match(/<meta name="description" content="(.*?)"/);
159} catch (error) {
160return new Response(JSON.stringify({
161error: 'Failed to fetch from timekeeper API',
162message: error.message,
163url: targetUrl,
8console.log(`Fetching from: ${targetUrl}`);
9
10// Fetch data from the timekeeper API
11const response = await fetch(targetUrl);
12
27// Extract useful information from the HTML if it's the main app
28let extractedInfo = null;
29if (endpoint === 'api' && data.includes('Timekeeper')) {
30// Extract metadata from the HTML
31const titleMatch = data.match(/<title>(.*?)<\/title>/);
65
66return new Response(JSON.stringify({
67error: 'Failed to fetch from timekeeper API',
68message: error.message,
69url: targetUrl,