Back
Version 134
1/8/2024
import { logMessage } from "https://esm.town/v/willthereader/logMessage";
export const fetchNewTangleCommentsUrl = (() => {
return (order, timestamp, page) => {
logMessage(
"debug",
`fetchNewTangleCommentsUrl called with order: ${order}, timestamp: ${timestamp}, page: ${page}`,
);
const url = new URL("https://www.readtangle.com/members/api/comments/");
url.searchParams.append("order", order.join(", "));
logMessage("info", `Order parameter set to: ${order.join(", ")}`);
if (timestamp) {
url.searchParams.append("created_at", encodeURIComponent(`>${timestamp}`));
} else {
console.log("Timestamp is undefined, no timestamp timestamp applied");
}
url.searchParams.append("page", page.toString());
logMessage("debug", `fetchNewTangleCommentsUrl returning with URL: ${url.toString()}`);
return url.toString();
};
})();
Updated: January 11, 2024