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=function&page=888&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 18323 results for "function"(1182ms)

12const isProd = false;
13
14export async function twitterAlert({ lastRunAt }: Interval) {
15 // If isProd, search for tweets since that last time this interval ran
16 // if not, search for tweets since 48 hours ago for testing

socialDataSearch_910575socialDataSearch1 match

@charmaine•Updated 1 month ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function socialDataSearch(query: string): Promise<SocialDataResponse> {
4 const url = new URL("https://stevekrouse-socialdataproxy.web.val.run/twitter/search");
5 url.searchParams.set("query", query);

dailyFeedbinDigestmain.tsx1 match

@kamalnrf•Updated 1 month ago
2import { summarizeFeedbinEntries } from "https://esm.town/v/kamalnrf/summarizeFeedbinEntries";
3
4export async function dailyFeedbinDigest() {
5 const result = await summarizeFeedbinEntries();
6

wikimain.tsx2 matches

@yawnxyz•Updated 1 month ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchFromWikipedia(params) {
4 const endpoint = 'https://en.wikipedia.org/w/api.php';
5 const url = `${endpoint}?${new URLSearchParams(params).toString()}`;
14}
15
16export async function searchWikipedia(searchTerm, additionalParams = {}) {
17 const defaultParams = {
18 action: 'query',

summarizeFeedbinEntriesmain.tsx4 matches

@kamalnrf•Updated 1 month ago
58`;
59
60async function feedbinUnreadEntries() {
61 const { result } = await (await fetch("https://kamalnrf-feedbinunreads.web.val.run")).json();
62 return result ?? [];
63}
64
65export async function summarizeFeedbinEntries() {
66 try {
67 const entries = await feedbinUnreadEntries();
154}
155
156// Helper function to strip HTML tags
157function stripHtml(html?: string) {
158 if (!html || typeof html !== "string") {
159 return "";

succinctCrimsonKoimain.tsx3 matches

@sarittusch•Updated 1 month ago
13];
14
15function App() {
16 const [noClicks, setNoClicks] = useState(0);
17 const [isValentine, setIsValentine] = useState(false);
91}
92
93function client() {
94 createRoot(document.getElementById("root")).render(<App />);
95}
96if (typeof document !== "undefined") { client(); }
97
98export default async function server(request: Request): Promise<Response> {
99 return new Response(
100

GitHubSyncvaltown-deploy6 matches

@tallesjp•Updated 1 month ago
17////
18
19export default async function valTownDeploy(c: Context) {
20 console.log("deploy to valtown");
21 const body = await c.req.json();
45}
46
47async function getContents(repo: Repo, after: string, commits: Commit[]) {
48 const filenames = config.vals.map((name: string) => name + ".tsx");
49 console.log(`${filenames.length} val files updated`);
55}
56
57function getModified(commits: Commit[], filenames: string[]) {
58 return commits.reduce((a: string[], b: Commit) => {
59 return [...a, ...b.modified];
61}
62
63function getFileContent(repo: Repo, after: string) {
64 return async (path: string): Promise<{
65 name: string;
81}
82
83async function updateVals(user: ValUser, updates: { name: string; code: string; }[]) {
84 console.log("updateVals");
85 await Promise.all(updates.map(async (update) => {
88}
89
90async function updateVal(username: string, update: { name: string; code: string; }) {
91 const { name, code } = update;
92 const val = await valtown.alias.username.valName.retrieve(username, name);

GitHubSyncsign-webhook1 match

@tallesjp•Updated 1 month ago
1/**
2 * Use this function along with your valtown webhook secret to create
3 * the x-val-signature header when posting to the /export webhook
4 */

GitHubSyncREADME.md1 match

@tallesjp•Updated 1 month ago
42const url = Deno.env.get("PUSH_URL") as string;
43
44async function pushValsToGitHub() {
45 const body = "hello";
46 const signature = await sign(body, secret);

GitHubSynchome1 match

@tallesjp•Updated 1 month ago
4import type { Context } from "npm:hono";
5
6export default async function(c: Context) {
7 return c.html(
8 <html>

getFileEmail4 file matches

@shouser•Updated 1 week ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 2 weeks ago
Simple functional CSS library for Val Town
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.