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)
1import { CONFIG } from "./config.tsx";
23export class DiscordAPI {
4// Fetch from the Discord API
5private async discordFetch(endpoint: string): Promise<any> {
6console.log(Deno.env.get("DISCORD_BOT_TOKEN"));
7console.log(`https://discord.com/api/v10${endpoint}`);
8const response = await fetch(`https://discord.com/api/v10${endpoint}`, {
9headers: { "Authorization": `Bot ${Deno.env.get("DISCORD_BOT_TOKEN")}` },
10});
11console.log(response.status);
12if (!response.ok) {
13throw new Error(`Discord API error: ${response.status}`);
14}
15
258}
259260/*──────────────────── 8 ▸ Scraping Logic ────────────────────────────────*/
261function buildChapterObject(
262$: cheerio.CheerioAPI,
263chapterLinkElement: cheerio.Element,
264seriesTitle: string,
299300async function scrapeMainPageForChapterEvents(): Promise<ChapterEventInfo[]> {
301log("Scraping main page for chapter events:", BASE_URL);
302const chapterEvents: ChapterEventInfo[] = [];
303try {
474seriesPageUrl: string,
475): Promise<Pick<ChapterEventInfo, "definitiveSeriesTitle" | "definitiveSeriesImage" | "synopsis">> {
476log("Scraping series page for details:", seriesPageUrl);
477try {
478const { data } = await httpClient.get(seriesPageUrl, { responseType: "text" });
586log(`=== Multi-Event Announcer (Ch1, Season Start/End) to ${PRIMARY_CHAT_ID} then ${SECONDARY_CHAT_ID} ===`);
587try {
588await bot.api.getMe();
589log("Bot token validated.");
590}
693log(`Announcing to PRIMARY (${PRIMARY_CHAT_ID}): ${nameOfManhwa} - Event: ${event.eventType}`);
694if (imageUrl && (event.eventType === EventType.NEW_SERIES || event.eventType === EventType.SEASON_START)) {
695await bot.api.sendPhoto(PRIMARY_CHAT_ID, imageUrl, { caption: messageContent, parse_mode: "HTML" });
696} else {
697await bot.api.sendMessage(PRIMARY_CHAT_ID, messageContent, {
698parse_mode: "HTML",
699disable_web_page_preview: false,
707if (BOT_OWNER_ID) {
708try {
709await bot.api.sendMessage(
710BOT_OWNER_ID,
711`PRIMARY SEND FAIL: ${event.eventType} for ${nameOfManhwa}.\nError: ${e.message.substring(0, 300)}`,
722log(`Reposting to SECONDARY (${SECONDARY_CHAT_ID}): ${nameOfManhwa} - Event: ${event.eventType}`);
723if (imageUrl && (event.eventType === EventType.NEW_SERIES || event.eventType === EventType.SEASON_START)) {
724await bot.api.sendPhoto(SECONDARY_CHAT_ID, imageUrl, { caption: messageContent, parse_mode: "HTML" });
725} else {
726await bot.api.sendMessage(SECONDARY_CHAT_ID, messageContent, {
727parse_mode: "HTML",
728disable_web_page_preview: false,
734if (BOT_OWNER_ID) {
735try {
736await bot.api.sendMessage(
737BOT_OWNER_ID,
738`SECONDARY REPOST FAIL: ${event.eventType} for ${nameOfManhwa} (Primary was OK).\nError: ${