112});
113
114export default app.fetch;
12 const submitBtn = document.querySelector('#valtown-submit');
13 async function getMessages() {
14 const r = await fetch('https://${valUser}-${valName}.express.val.run');
15 msgList.innerHTML = '<ul>';
16 msgList.innerHTML += (await r.json()).map(msg => {
21 async function sendMessage() {
22 submitBtn.disabled = true
23 const r = await fetch('https://${valUser}-${valName}.express.val.run', {
24 method: 'POST',
25 headers: {
1export default async function(req: Request): Promise<Response> {
2 const resp = await fetch("https://streamtape.com/v/", { "method": "GET", redirect: "manual" });
3 console.log(resp.headers.get("location"));
4 return new Response(resp.body, { headers: resp.headers });
1export const fetchWikipediaContent = async (req: Request) => {
2 const url = new URL(req.url);
3 const title = url.searchParams.get("title");
15 encodeURIComponent(title)
16 }`;
17 const response = await fetch(apiUrl);
18 if (!response.ok) {
19 throw new Error(`HTTP error! status: ${response.status}`);
32 });
33 } catch (error) {
34 return new Response(`Error fetching Wikipedia content: ${error.message}`, {
35 status: 500, // Internal Server Error
36 headers: { "Content-Type": "text/plain" },
36 <script>
37 document.getElementById('randomizeBtn').addEventListener('click', async () => {
38 const response = await fetch('/randomize', { method: 'POST' });
39 const result = await response.json();
40 alert(result.message);
58 const randomColor = colors[Math.floor(Math.random() * colors.length)];
59
60 const response = await fetch(`https://api.notion.com/v1/blocks/${blockId}`, {
61 method: "PATCH",
62 headers: {
77});
78
79export default app.fetch;
47 const url = `https://trends.google.com/trending/rss?geo=${location}`;
48 console.log("url", url);
49 const response = await fetch(url);
50
51 if (response.status !== 200) {
65 const { startDate, endDate } = getYesterdayDateRange();
66
67 const response = await fetch("https://api.linear.app/graphql", {
68 method: "POST",
69 headers: {
80
81 if (data.errors) {
82 console.error("Error fetching data from Linear API:", data.errors);
83 Deno.exit(1);
84 }
86 const issues = data.data.viewer.assignedIssues.nodes;
87
88 // Group issues by team and fetch issue history
89 const issuesByTeam: { [teamName: string]: any[] } = {};
90 for (const issue of issues) {
94 }
95
96 const historyResponse = await fetch("https://api.linear.app/graphql", {
97 method: "POST",
98 headers: {
110 if (historyData.errors) {
111 console.error(
112 `Error fetching history for issue ${issue.id}:`,
113 historyData.errors,
114 );
190 }
191
192 const slackResponse = await fetch("https://slack.com/api/chat.postMessage", {
193 method: "POST",
194 headers: {
1import { fetch as proxiedFetch } from "https://esm.town/v/std/fetch";
2import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
3import { convertHTMLToJSON } from "https://esm.town/v/tempguy/liteutils";
4const baseURLReq = await fetch(
5 "https://multiembed.mov?video_id=114472&tmdb=1&s=1&e=2",
6 {
17};
18
19const baseReq = await proxiedFetch(baseURL, {
20 "headers": headers,
21 "body":
29const source = match[1];
30
31const serverList = await proxiedFetch("https://streambucket.net/response.php", {
32 method: "POST",
33 body: `token=${source}`,
41});
42console.log(await convertHTMLToJSON(await serverList.text()));
43const embedPage = await proxiedFetch(
44 "https://tempguy-copperscorpion.web.val.run?destination="
45 + encodeURIComponent(
68if (!match) throw new Error("No match found");
69console.log(url);
70const player = await fetch(url[1]);
71const regex = /eval\(function\(h,u,n,t,e,r\).*?\("(.*?)",\d*?,"(.*?)",(\d*?),(\d*?),\d*?\)\)/;
72const linkRegex = /file:"(.*?)"/;
233});
234
235export default app.fetch;
1fetch contents of a specific wikipedia page using `?title=`param. will return nothing if page doesn't exactly match. example: https://jamiedubs-wikipediapage.web.val.run/?title=Berlin
2
3for a more search-oriented approach, try https://www.val.town/v/jamiedubs/searchWikipedia