1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { constructReadTangleUrl } from "https://esm.town/v/willthereader/constructReadTangleUrl";
import { fetchComments } from "https://esm.town/v/willthereader/fetchComments";
import { FilterCommentsVal } from "https://esm.town/v/willthereader/FilterCommentsVal";
import { formattingEmailContent } from "https://esm.town/v/willthereader/formattingEmailContent";
import { logMessage } from "https://esm.town/v/willthereader/logMessage";
import { post_idFetcher } from "https://esm.town/v/willthereader/post_idFetcher";
export async function Sendingemail() {
// console.log("Sendingemail function called");
try {
let lastRunDate = new Date("2023-11-10T19:27:25.547Z");
lastRunDate = new Date();
const post_ids = await post_idFetcher();
// console.log("post_ids: ", post_ids);
const firstTwoPost_ids = post_ids.slice(2, 3);
const ReadTangleUrl = await Promise.all(firstTwoPost_ids.map(constructReadTangleUrl));
// console.log("ReadTangleUrl: ", ReadTangleUrl);
// return ReadTangleUrl;
const Comments = await fetchComments(ReadTangleUrl);
// console.log("Comments: ", Comments);
return Comments;
// const formatedEmailContent = formattingEmailContent(Comments)
} catch (error) {
console.log("Caught an error:", error);
}
}
const urls = await Sendingemail();
// console.log(typeof urls);
console.log(urls);
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
January 16, 2024