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/$2?q=function&page=30&format=json

For typeahead suggestions, use the /typeahead endpoint:

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

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

Found 29089 results for "function"(720ms)

displaymain.tsx1 match

@charmaineUpdated 23 hours ago
1export default async function (req: Request): Promise<Response> {
2 return new Response(`Hellom XYZ\n${Date.now() % 100000000}`, {
3 headers: {

displaymain.tsx1 match

@tmcwUpdated 23 hours ago
1export default async function (req: Request): Promise<Response> {
2 return new Response(`Hellom XYZ\n${Date.now() % 100000000}`, {
3 headers: {

scrapetestREADME.md1 match

@wolfUpdated 23 hours ago
7- **Flight Search Form** - Enter origin, destination, and travel dates
8- **Real-time Results** - Display scraped flight information in a user-friendly format
9- **Export Functionality** - Download results as JSON for further analysis
10- **Error Handling** - Clear error messages and loading states
11- **Responsive Design** - Works on desktop and mobile devices

scrapetestscraper.ts8 matches

@wolfUpdated 23 hours ago
1import { FlightSearchParams, FlightResult, ScrapingResult } from "../shared/types.ts";
2
3export async function scrapeFlights(params: FlightSearchParams): Promise<ScrapingResult> {
4 const { origin, destination, departDate, returnDate } = params;
5
57}
58
59async function scrapeFrontierDirect(params: FlightSearchParams): Promise<ScrapingResult> {
60 const searchUrl = buildFrontierSearchUrl(params);
61 console.log(`Direct search URL: ${searchUrl}`);
88}
89
90async function scrapeFrontierMainPage(params: FlightSearchParams): Promise<ScrapingResult> {
91 console.log("Trying main page approach...");
92
120}
121
122async function generateSampleData(params: FlightSearchParams): Promise<ScrapingResult> {
123 console.log("Generating sample data as fallback...");
124
198}
199
200function buildFrontierSearchUrl(params: FlightSearchParams): string {
201 // Try multiple URL patterns that Frontier might use
202 const patterns = [
218}
219
220function parseFlightData(html: string): FlightResult[] {
221 const flights: FlightResult[] = [];
222
261}
262
263function parseJsonFlightData(data: any[]): FlightResult[] {
264 const flights: FlightResult[] = [];
265
294}
295
296function parseHtmlFlightData(html: string): FlightResult[] {
297 const flights: FlightResult[] = [];
298

scrapetestapp.js12 matches

@wolfUpdated 23 hours ago
1let currentResults = null;
2
3document.addEventListener('DOMContentLoaded', function() {
4 const searchForm = document.getElementById('searchForm');
5 const searchBtn = document.getElementById('searchBtn');
14 document.getElementById('departDate').value = tomorrow.toISOString().split('T')[0];
15
16 searchForm.addEventListener('submit', async function(e) {
17 e.preventDefault();
18
28 });
29
30 exportBtn.addEventListener('click', function() {
31 if (currentResults) {
32 downloadJSON(currentResults, `frontier-flights-${Date.now()}.json`);
34 });
35
36 async function searchFlights(params) {
37 try {
38 showLoading();
65 }
66
67 function displayResults(data) {
68 const resultsContent = document.getElementById('resultsContent');
69
160 }
161
162 function showLoading() {
163 loading.classList.remove('hidden');
164 searchBtn.disabled = true;
166 }
167
168 function hideLoading() {
169 loading.classList.add('hidden');
170 searchBtn.disabled = false;
172 }
173
174 function showResults() {
175 results.classList.remove('hidden');
176 }
177
178 function hideResults() {
179 results.classList.add('hidden');
180 }
181
182 function showError(message) {
183 document.getElementById('errorMessage').textContent = message;
184 error.classList.remove('hidden');
185 }
186
187 function hideError() {
188 error.classList.add('hidden');
189 }
190
191 function downloadJSON(data, filename) {
192 const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' });
193 const url = URL.createObjectURL(blob);

MindfulMilescada_quince_minutes.ts2 matches

@profMoishUpdated 23 hours ago
1function sendNotification() {
2 const TOKEN = process.env.TELEGRAM_BOT_TOKEN;
3 const CHAT_ID = 1825527066;
26 * Главная функция cron-триггера
27 */
28export default async function() {
29 sendNotification();
30}

EEPPortalweeklyReport.tsx6 matches

@solomonferedeUpdated 23 hours ago
246};
247
248function WeeklyReportTab() {
249 // State for the detailed report (news and media)
250 const [detailedReport, setDetailedReport] = useState(null);
290 const [selectedContent, setSelectedContent] = useState("");
291
292 // Function to fetch the detailed report
293 const fetchDetailedReport = async () => {
294 setDetailedReport(null); // Clear previous detailed data while fetching
303 };
304
305 // Function to fetch the weekly summary report with custom days
306 const fetchWeeklySummary = async (days = 7) => {
307 setWeeklySummary(null); // Clear previous summary data while fetching
455 }, [weeklySummary]);
456
457 // Function to handle click on author name in Weekly Summary
458 const handleAuthorClick = (authorId, authorFullName) => {
459 if (!detailedReport || !detailedReport.newsArticles || !detailedReport.mediaEntries) {
482 };
483
484 // Function to close the author detail modal
485 const handleCloseAuthorDetailModal = () => {
486 setIsAuthorDetailModalOpen(false);
490 };
491
492 // Helper function for CSV export
493 const exportToCSV = (data, filename) => {
494 if (!data || data.length === 0) {

EEPPortalnewsArticle.tsx6 matches

@solomonferedeUpdated 23 hours ago
388);
389// Main Component for the News Article (Contents) Tab
390export function NewsArticleTab({ user }: { user: CurrentUser | null }) {
391 const [articles, setArticles] = useState<Article[]>([]);
392 const [title, setTitle] = useState("");
580 }
581 };
582 // Function to open the edit modal - Similar pattern to MediaMonitoringTab
583 const handleEditClick = (article: Article) => {
584 setEditFormData({
598 setEditModalError(""); // Clear modal-specific error
599 };
600 // Function to close the edit modal - Similar pattern to MediaMonitoringTab
601 const handleCloseEditModal = () => {
602 setIsEditModalOpen(false);
615 setEditModalError(""); // Clear modal-specific error on close
616 };
617 // Function to handle changes in the edit modal form - Similar pattern to MediaMonitoringTab
618 const handleEditFormChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => {
619 const { name, value } = e.target;
623 }));
624 };
625 // Function to save the edited entry
626 const handleSaveEdit = async () => {
627 // Validate required fields from editFormData
682 }
683 };
684 // Function to clear all filters
685 const clearFilters = () => {
686 setTitleFilter("");

EEPPortalfeeds.tsx2 matches

@solomonferedeUpdated 23 hours ago
138 color: BRAND_COLORS.darkGreen,
139 marginBottom: "10px",
140 cursor: "pointer", // Added for toggle functionality
141 },
142 commentItem: {
247}
248
249export function FeedsTab(
250 { user, onNavigateToNewsArticleTab }: { user: CurrentUser | null; onNavigateToNewsArticleTab: () => void },
251) {

MindfulMilescada_hora.ts2 matches

@profMoishUpdated 23 hours ago
1function sendNotification() {
2 const TOKEN = process.env.TELEGRAM_BOT_TOKEN;
3 const CHAT_ID = 1825527066;
26 * Главная функция cron-триггера
27 */
28export default async function() {
29 sendNotification();
30}
tuna

tuna9 file matches

@jxnblkUpdated 23 hours ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouserUpdated 1 month ago
A helper function to build a file's email
lost1991
import { OpenAI } from "https://esm.town/v/std/openai"; export default async function(req: Request): Promise<Response> { if (req.method === "OPTIONS") { return new Response(null, { headers: { "Access-Control-Allow-Origin": "*",
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.