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=52&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 11499 results for "api"(611ms)
129130try {
131const url = `https://api.github.com/repos/${repo}/issues/${prNumber}/assignees`;
132console.log("๐ Sending assignee request to:", url);
133145});
146147console.log("๐ GitHub API response status:", response.status);
148149if (response.ok) {
155try {
156const error = await response.json();
157console.error("โ GitHub API error:", JSON.stringify(error));
158errorMessage = error.message || errorMessage;
159168} catch (e) {
169const errorText = await response.text();
170console.error("โ GitHub API error text:", errorText);
171}
172return { success: false, message: errorMessage };
173}
174} catch (error) {
175console.error("โ Exception during API call:", error);
176return { success: false, message: error.message };
177}
34};
3536// Types for Slack API
37type SlackMessage = {
38blocks: any[];
323324// Get PR details
325const url = `https://api.github.com/repos/${repo}/pulls/${prNumber}`;
326console.log("๐ Fetching from GitHub API URL:", url);
327328let response;
335},
336});
337console.log("๐ GitHub API response received");
338console.log("๐ Response status:", response.status);
339console.log("๐ Response status text:", response.statusText);
346347if (!response.ok) {
348console.error(`โ GitHub API error: ${response.status} ${response.statusText}`);
349350let errorText;
351try {
352errorText = await response.text();
353console.error("โ GitHub API error response:", errorText);
354355try {
356// Try to parse as JSON for more details
357const errorJson = JSON.parse(errorText);
358console.error("โ GitHub API error details:", JSON.stringify(errorJson));
359} catch (e) {
360// Not JSON, that's fine
370try {
371data = await response.json();
372console.log("๐ Successfully parsed GitHub API response");
373} catch (jsonError) {
374console.error("โ Failed to parse GitHub API response:", jsonError);
375376try {
384}
385386throw new Error(`Failed to parse GitHub API response: ${jsonError.message}`);
387}
388400}
401402// Merge a PR via GitHub API
403async function mergePR(repo: string, prNumber: number) {
404console.log(`๐ Starting mergePR for PR #${prNumber} in ${repo}`);
448449// Proceed with merge
450const url = `https://api.github.com/repos/${repo}/pulls/${prNumber}/merge`;
451console.log("๐ Sending merge request to:", url);
452468body: mergeBody,
469});
470console.log("๐ Merge API response received");
471console.log("๐ Response status:", response.status);
472console.log("๐ Response status text:", response.statusText);
638body: JSON.stringify(message),
639});
640console.log("๐ Slack API response received");
641console.log("๐ Response status:", response.status);
642console.log("๐ Response status text:", response.statusText);
649650if (!response.ok) {
651console.error(`โ Slack API error: ${response.status} ${response.statusText}`);
652653let errorText;
654try {
655errorText = await response.text();
656console.error("โ Slack API error response:", errorText);
657} catch (e) {
658console.error("โ Could not read error response:", e);