16 : Math.floor((Date.now() - 2 * 24 * 60 * 60 * 1000) / 1000);
17
18 // Fetch and log tweets
19 const response = await socialDataSearch(`${query} since_time:${timeFrame}`);
20 console.log("Response from socialDataSearch:", response);
28
29 try {
30 // Fetch user data
31 const resp = await client.me.profile.retrieve();
32 const token = jwt.sign(resp, privateKeyPem, { algorithm: "RS256", expiresIn: "1h" });
142}
143
144export default app.fetch.bind(app);
28
29 try {
30 // Fetch user data
31 const resp = await client.me.profile.retrieve();
32 const token = jwt.sign(resp, privateKeyPem, { algorithm: "RS256", expiresIn: "1h" });
142}
143
144export default app.fetch.bind(app);
82 if (!code) return c.text("No code provided", 400);
83
84 const tokenResponse = await fetch("https://github.com/login/oauth/access_token", {
85 method: "POST",
86 headers: {
97 const { access_token } = await tokenResponse.json();
98
99 const userResponse = await fetch("https://api.github.com/user", {
100 headers: {
101 "Authorization": `token ${access_token}`,
302}
303
304export default app.fetch;
305
306interface CommitOptions {
35
36async function execute(statement: InStatement, args?: InArgs): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
39 headers: {
50
51async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
52 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
53 method: "POST",
54 headers: {
1async function createWorker(url: string) {
2 const workerScript = await fetch(url);
3 const workerURL = URL.createObjectURL(await workerScript.blob());
4 return new Worker(workerURL, { type: "module" });
24 : Math.floor((Date.now() - 2 * 24 * 60 * 60 * 1000) / 1000);
25
26 // Fetch and log tweets
27 const response = await socialDataSearch(`${query} since_time:${since}`);
28 console.log("Response from socialDataSearch:", response);
1import { fetch } from "https://esm.town/v/std/fetch"
2import { getDuckDB } from "https://esm.town/v/tmcw/getDuckDB"
3
4export const duckDbCsv = (async () => {
5 const db = await getDuckDB()
6 const r = await fetch(
7 "https://raw.githubusercontent.com/fivethirtyeight/data/master/san-andreas/earthquake_data.csv",
8 )
1export const dailySlackRoundup = async () => {
2 const res = await fetch(process.env.BRAINBOT_WEBHOOK_URL, {
3 method: "POST",
4 body: JSON.stringify({
14 start = performance.now();
15 try {
16 const res = await fetch(url);
17 end = performance.now();
18 status = res.status;
25 } catch (e) {
26 end = performance.now();
27 reason = `couldn't fetch: ${e}`;
28 ok = false;
29 console.log(`Website down (${url}): ${reason} (${end - start}ms)`);