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 }
1import cheerio from "https://esm.sh/cheerio@1.0.0-rc.12";
2
3async function fetchJobCount(url: string): Promise<{ count: number; month: string; year: string } | null> {
4 try {
5 const response = await fetch(url);
6 if (!response.ok) {
7 console.error(`Failed to fetch ${url}: ${response.status} ${response.statusText}`);
8 return null;
9 }
20 return { count, month, year };
21 } catch (error) {
22 console.error(`Error fetching ${url}:`, error);
23 return null;
24 }
55
56 for (const url of urls) {
57 const result = await fetchJobCount(url);
58 if (result) {
59 console.log(`${result.count} jobs, ${result.month} ${result.year}`);
51 const id = path.split("/")[2];
52 if (id && id !== "undefined") {
53 fetchDocument(id);
54 setMode(path.startsWith("/view/") ? "view" : "edit");
55 } else {
59 }, []);
60
61 const fetchDocument = async (id) => {
62 try {
63 const response = await fetch(`/api/document/${id}`);
64 if (!response.ok) {
65 throw new Error(`HTTP error! status: ${response.status}`);
70 setForkId(data.id);
71 } catch (e) {
72 console.error("Error fetching document:", e);
73 setError("Error fetching document. Please try again.");
74 }
75 };
78 e.preventDefault();
79 try {
80 const response = await fetch("/api/document", {
81 method: "POST",
82 headers: { "Content-Type": "application/json" },
80
81async function getWallabagToken(config: any) {
82 const response = await fetch(`${config.WALLABAG_URL}/oauth/v2/token`, {
83 method: "POST",
84 headers: {
99
100async function saveToWallabag(url: string, token: string, config: any) {
101 const response = await fetch(`${config.WALLABAG_URL}/api/entries.json`, {
102 method: "POST",
103 headers: {
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({
9});
10
11export default lastlogin(vscode.fetch, { verifyEmail });
186
187 try {
188 const response = await fetch("/", {
189 method: "POST",
190 body: JSON.stringify({
36
37 useEffect(() => {
38 async function fetchStats() {
39 const response = await fetch("/dashboard-stats");
40 const data = await response.json();
41 setStats(data);
42 }
43 fetchStats();
44 }, []);
45
146
147 try {
148 const response = await fetch("/", {
149 method: "POST",
150 body: JSON.stringify({
88export type WideApi = typeof routes;
89
90export default app.fetch.bind(app);
36
37 useEffect(() => {
38 async function fetchStats() {
39 const response = await fetch("/dashboard-stats");
40 const data = await response.json();
41 setStats(data);
42 }
43 fetchStats();
44 }, []);
45
146
147 try {
148 const response = await fetch("/", {
149 method: "POST",
150 body: JSON.stringify({