You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$%7Bsuccess?q=fetch&page=10&format=json
For typeahead suggestions, use the /typeahead
endpoint:
https://codesearch.val.run/typeahead?q=fetch
Returns an array of strings in format "username" or "username/projectName"
Found 8143 results for "fetch"(1364ms)
1112useEffect(() => {
13fetchShorts();
14}, []);
1516const fetchShorts = async () => {
17try {
18const response = await fetch('/get-shorts');
19const data = await response.json();
20setShorts(data);
21} catch (err) {
22console.error('Failed to fetch shorts', err);
23}
24};
4041try {
42const response = await fetch('/add-short', {
43method: 'POST',
44headers: {
50if (response.ok) {
51setNewShortLink('');
52fetchShorts();
53}
54} catch (err) {
1import makeFetchCookie from "npm:fetch-cookie";
2const fetchCookie = makeFetchCookie(fetch);
34export default async function handleCron(interval) {
5const following = await fetchCookie(
6"https://www.instagram.com/api/v1/friendships/375942300/following/?query=miguelse10",
7{
16const isFollowing = following.users.some((user) => user.username === "miguelse10");
1718const pushNotification = await fetchCookie("https://ntfy.sh/alEMfLpdpoXMe6jB", {
19method: "POST",
20body: `Mafalda ${isFollowing ? "lo está siguiendo" : "no lo está siguiendo"} a Miguel.`,