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/$%7Bart_info.art.src%7D?q=api&page=69&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 17934 results for "api"(1253ms)

myApi1 file match

@jacob_kettle•Updated 1 year ago

postHogAPICapture1 file match

@ianvph•Updated 1 year ago

myApi1 file match

@ollypolly•Updated 1 year ago

Discord-to-Lineardiscord.tsx5 matches

@hussufo•Updated 35 mins ago
1import { CONFIG } from "./config.tsx";
2
3export class DiscordAPI {
4 // Fetch from the Discord API
5 private async discordFetch(endpoint: string): Promise<any> {
6 console.log(Deno.env.get("DISCORD_BOT_TOKEN"));
7 console.log(`https://discord.com/api/v10${endpoint}`);
8 const response = await fetch(`https://discord.com/api/v10${endpoint}`, {
9 headers: { "Authorization": `Bot ${Deno.env.get("DISCORD_BOT_TOKEN")}` },
10 });
11 console.log(response.status);
12 if (!response.ok) {
13 throw new Error(`Discord API error: ${response.status}`);
14 }
15

asurareleasesbotsender.ts11 matches

@asurgift•Updated 39 mins ago
258}
259
260/*──────────────────── 8 ▸ Scraping Logic ────────────────────────────────*/
261function buildChapterObject(
262 $: cheerio.CheerioAPI,
263 chapterLinkElement: cheerio.Element,
264 seriesTitle: string,
299
300async function scrapeMainPageForChapterEvents(): Promise<ChapterEventInfo[]> {
301 log("Scraping main page for chapter events:", BASE_URL);
302 const chapterEvents: ChapterEventInfo[] = [];
303 try {
474 seriesPageUrl: string,
475): Promise<Pick<ChapterEventInfo, "definitiveSeriesTitle" | "definitiveSeriesImage" | "synopsis">> {
476 log("Scraping series page for details:", seriesPageUrl);
477 try {
478 const { data } = await httpClient.get(seriesPageUrl, { responseType: "text" });
586 log(`=== Multi-Event Announcer (Ch1, Season Start/End) to ${PRIMARY_CHAT_ID} then ${SECONDARY_CHAT_ID} ===`);
587 try {
588 await bot.api.getMe();
589 log("Bot token validated.");
590 }
693 log(`Announcing to PRIMARY (${PRIMARY_CHAT_ID}): ${nameOfManhwa} - Event: ${event.eventType}`);
694 if (imageUrl && (event.eventType === EventType.NEW_SERIES || event.eventType === EventType.SEASON_START)) {
695 await bot.api.sendPhoto(PRIMARY_CHAT_ID, imageUrl, { caption: messageContent, parse_mode: "HTML" });
696 } else {
697 await bot.api.sendMessage(PRIMARY_CHAT_ID, messageContent, {
698 parse_mode: "HTML",
699 disable_web_page_preview: false,
707 if (BOT_OWNER_ID) {
708 try {
709 await bot.api.sendMessage(
710 BOT_OWNER_ID,
711 `PRIMARY SEND FAIL: ${event.eventType} for ${nameOfManhwa}.\nError: ${e.message.substring(0, 300)}`,
722 log(`Reposting to SECONDARY (${SECONDARY_CHAT_ID}): ${nameOfManhwa} - Event: ${event.eventType}`);
723 if (imageUrl && (event.eventType === EventType.NEW_SERIES || event.eventType === EventType.SEASON_START)) {
724 await bot.api.sendPhoto(SECONDARY_CHAT_ID, imageUrl, { caption: messageContent, parse_mode: "HTML" });
725 } else {
726 await bot.api.sendMessage(SECONDARY_CHAT_ID, messageContent, {
727 parse_mode: "HTML",
728 disable_web_page_preview: false,
734 if (BOT_OWNER_ID) {
735 try {
736 await bot.api.sendMessage(
737 BOT_OWNER_ID,
738 `SECONDARY REPOST FAIL: ${event.eventType} for ${nameOfManhwa} (Primary was OK).\nError: ${
Kapil01
apiv1