182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({
19 : Math.floor((Date.now() - 2 * 24 * 60 * 60 * 1000) / 1000);
20
21 // Fetch and log tweets
22 const response = await socialDataSearch(`${query} since_time:${timeFrame}`);
23 console.log("Response from socialDataSearch:", response);
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({
44 useEffect(() => {
45 if (selectedCategory === "tournament") {
46 fetchScoreboard();
47 }
48 }, [selectedCategory]);
55
56 try {
57 const response = await fetch("/register", {
58 method: "POST",
59 headers: { "Content-Type": "application/json" },
65 setRegisteredName(playerName);
66 setRegistrationError("");
67 fetchScoreboard();
68 } else {
69 setRegistrationError(result.message || "Registration failed");
74 };
75
76 const fetchScoreboard = async () => {
77 try {
78 const response = await fetch("/scoreboard");
79 const data = await response.json();
80 setScoreboard(data);
81 } catch (error) {
82 console.error("Failed to fetch scoreboard", error);
83 }
84 };
298 return c.json("success");
299});
300export default app.fetch;
42
43 try {
44 const response = await fetch(`https://www.shovel.report/api/domains/${domain}`);
45 if (!response.ok) {
46 throw new Error(`HTTP error! status: ${response.status}`);
52 };
53 } catch (error) {
54 console.error("Error fetching technologies:", error);
55 return { services: [], social_media: {} };
56 }
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);
189 }
190 // Publish message
191 return await fetch(`${this.serverUrl}/${this.topic}`, {
192 method: "POST",
193 body: this.message ?? this.file,
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({
6const COLUMN_ID = "status__1"; // Replace with your column ID for domains
7
8// Fetch domains from monday.com
9async function fetchDomainsFromMonday(): Promise<string[]> {
10 if (!MONDAY_API_KEY) {
11 throw new Error("monday.com API key not configured");
24 `;
25
26 const response = await fetch("https://api.monday.com/v2", {
27 method: "POST",
28 headers: {
34
35 if (!response.ok) {
36 throw new Error(`Failed to fetch domains: ${response.statusText}`);
37 }
38
58
59 try {
60 await fetch(slackWebhookUrl, {
61 method: "POST",
62 headers: { "Content-Type": "application/json" },
74 const start = performance.now();
75 try {
76 const res = await fetch(url);
77 end = performance.now();
78 status = res.status;
85 } catch (e) {
86 end = performance.now();
87 reason = `couldn't fetch: ${e}`;
88 ok = false;
89 console.log(`Website down (${url}): ${reason} (${end - start}ms)`);
103// Main function
104export default async () => {
105 const domains = await fetchDomainsFromMonday();
106
107 for (const url of domains) {