55/* ------------------------------------------------------------------ */
56/* Utility: minimal XML escaping (only for text nodes) */
57function escapeXml(str: string = ""): string {
58return str
59.replace(/&/g, "&")
Timenew-file-5970.html7 matches
42stopButton.addEventListener('click', stopSpeaking);
4344function startSpeaking() {
45speaking = true;
46startButton.disabled = true;
50}
5152function stopSpeaking() {
53speaking = false;
54startButton.disabled = false;
57}
5859function updateTimer() {
60const currentTime = new Date();
61const hours = currentTime.getHours();
69}
7071function speakTime() {
72const currentTime = new Date();
73const hours = currentTime.getHours();
106}
107108function getNumberWord(num) {
109const numbers = {
1101: 'one', 2: 'two', 3: 'three', 4: 'four', 5: 'five',
121}
122123function getTensNumberWord(num) {
124const tens = Math.floor(num / 10) * 10;
125const ones = num % 10;
131}
132133function getSpecialNumberWord(num) {
134const specialNumbers = {
13510: 'ten', 11: 'eleven', 12: 'twelve', 13: 'thirteen', 14: 'fourteen',
6});
78export default async function(interval: Interval) {
9// Initializing a client
10const notion = new Client({
getDatagetData.tsx1 match
1// @val-town/api
2export default async function(req: Request): Promise<Response> {
3return Response.json({
4status: "ok",
ColosseumcheckAvail.tsx12 matches
1112**/
13export async function checkAvail({ type, date, debug, notify }: {
14type: string;
15date: string;
26];
27const USER_AGENT = UA_LIST[Math.floor(Math.random() * UA_LIST.length)];
28function getHeaders(opts) {
29const { cookies, referer } = opts;
30const cookieObj = cookies
74},
75};
76function findThatScript(htmlText: string) {
77const $ = cheerio.load(htmlText);
78const firstBodyScript = $("body script")[0];
92return res;
93}
94async function safeEvalOctofenceTokenValTown(script: string) {
95const res = await fetch("https://api.val.town/v1/eval", {
96method: "POST",
106return await res.json();
107}
108async function getOctofenceToken(htmlText: string) {
109const script = findThatScript(htmlText);
110// octofence_token
112return octofence_token;
113}
114function fetchCalendar(
115id: string,
116month: number,
137});
138}
139async function getToken(id: string, thisMonth: number, eventPageUrl: string) {
140const resWithAuthToken = await fetchCalendar(id, thisMonth, eventPageUrl);
141const htmlWithAuth = await resWithAuthToken.text();
159return token;
160}
161function fetchDateSlots(
162date: string,
163id: string,
176});
177}
178function extractAvailSlots(html: string): Array<{
179time: string;
180tickets: number;
212debug && console.log("Cal html: ", calThisMonth);
213// Parse cal
214function extractAvailDates(calHtml: string) {
215const $ = cheerio.load(calHtml);
216const availableDatesEL = $(".available.active").toArray();
222];
223debug && console.log("Avail dates: ", availableDates);
224function isDateAvail(availableDates, date) {
225const compare = (d) => {
226const dArr = d.split("/");
241coupleSlots = slots.filter((s) => s.tickets >= 2);
242if (coupleSlots.length > 0) {
243function getCartCartLink(
244productId: string,
245performanceId: string,
1import { checkAvail } from "https://esm.town/v/lirenxn/checkAvail";
23export async function runCheckUnderground() {
4const result = await checkAvail({
5type: "underground",
3import { set } from "https://esm.town/v/std/set?v=11";
45export async function runCheckUnderground2() {
6const result = await checkAvail({
7type: "underground",
ColosseummailMeTheLink.tsx1 match
1112**/
13export function mailMeTheLink({ calLink, date, type, slots }: {
14calLink: string;
15date: string;
nell-parker-townindex.ts1 match
1export default async function (req: Request): Promise<Response> {
2return Response.json({ ok: true })
3}
Work_Time_Calculator_2main.tsx7 matches
1function parseTimeRanges(daySchedule) {
2// console.log(`Parsing schedule: ${daySchedule}`);
3const timeRanges = daySchedule.match(/(\d{1,2}(?::\d{2})?(?:am|pm)?)/g);
53}
5455function convertTo24HourFormat(time) {
56if (!time) {
57throw new Error("Invalid time input: time is undefined or empty");
91}
9293function calculateDuration(day, startTime, endTime) {
94console.log(`calculateDuration: Calculating duration on ${day} from ${startTime} to ${endTime}`);
95const start24 = convertTo24HourFormat(startTime);
112}
113114function calculateDailyTotal(day, parsedSchedule) {
115console.log(`calculateDailyTotal: Calculating daily total for ${day}`, parsedSchedule);
116let totalMinutes = 0;
130}
131132function calculateWeeklyTotal(day, dailyTotals) {
133console.log(`calculateWeeklyTotal: Calculating weekly total for daily totals for ${day} is`, dailyTotals);
134let totalHours = 0;
148}
149150function isValidDay(day) {
151const validDays = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
152return validDays.includes(day.charAt(0).toUpperCase() + day.slice(1).toLowerCase());
153}
154155function calculateWorkTime(schedule) {
156const dailyTotals = [];
157const scheduleArray = schedule.split("\n").filter(Boolean);