From 597d338510826d14a5a471ee85a20ac4edbb758c Mon Sep 17 00:00:00 2001 From: Dominic Arrojado Date: Sat, 4 May 2024 10:24:39 +0800 Subject: [PATCH] implement changes to move ktm train tickets to telegrarm --- app/about/page.tsx | 6 +- app/how-it-works/page.tsx | 4 +- app/topics/cdc-appointment-slots/page.tsx | 6 +- .../cdc-practical-lesson-slots/page.tsx | 6 +- .../japan-visa-appointment-slots/page.tsx | 6 +- app/topics/ktm-train-tickets/page.tsx | 59 ++++++------ .../train-schedule-table.tsx | 5 + lib/api-hooks.ts | 2 +- lib/content.tsx | 92 +++++-------------- lib/enums.ts | 3 +- 10 files changed, 71 insertions(+), 118 deletions(-) diff --git a/app/about/page.tsx b/app/about/page.tsx index 610e416..18417ec 100644 --- a/app/about/page.tsx +++ b/app/about/page.tsx @@ -41,9 +41,9 @@ export default function About() { SG Alerts is a free notification - service that sends you an email or a Telegram message depending on the - topics you've subscribed to. It's a simple service that helps - you stay up to date with the latest information without having to + service that sends you an email or a Telegram notification depending on + the topics you've subscribed to. It's a simple service that + helps you stay up to date with the latest information without having to constantly check the source website. diff --git a/app/how-it-works/page.tsx b/app/how-it-works/page.tsx index c95e514..d7a2acb 100644 --- a/app/how-it-works/page.tsx +++ b/app/how-it-works/page.tsx @@ -42,8 +42,8 @@ export default function HowToUse() { SG Alerts is a free notification service that monitors the websites and sends you an email notification - or a Telegram message when there are new updates. It is designed to help - you save time and effort by automating the process of checking for + or a Telegram notification when there are new updates. It is designed to + help you save time and effort by automating the process of checking for updates. diff --git a/app/topics/cdc-appointment-slots/page.tsx b/app/topics/cdc-appointment-slots/page.tsx index 1ece3f7..9a3aea8 100644 --- a/app/topics/cdc-appointment-slots/page.tsx +++ b/app/topics/cdc-appointment-slots/page.tsx @@ -78,9 +78,9 @@ export default function CdcAppointmentSlots() { CDC - . You will receive an email notification when new appointment slots are - available. If there's an earlier date available, you will also be - notified. You save time and effort by not having to check the{" "} + . You will receive a Telegram notification when new appointment slots + are available. If there's an earlier date available, you will also + be notified. You save time and effort by not having to check the{" "} CDC {" "} diff --git a/app/topics/cdc-practical-lesson-slots/page.tsx b/app/topics/cdc-practical-lesson-slots/page.tsx index 82de8ef..73d05b0 100644 --- a/app/topics/cdc-practical-lesson-slots/page.tsx +++ b/app/topics/cdc-practical-lesson-slots/page.tsx @@ -101,9 +101,9 @@ export default function CdcPracticalLessonSlots() { {" "} website for available practical lesson slots for Class 3A Motorcar (for Standard only, not applicable for One Team or Elite Team). It sends you - a notification when there are new slots available so you can save time - and effort. It is not a guarantee that you will get the slots you want, - but it will definitely increase your chances of getting them. + a Telegram notification when there are new slots available so you can + save time and effort. It is not a guarantee that you will get the slots + you want, but it will definitely increase your chances of getting them. To get started, simply click the button below to subscribe to the diff --git a/app/topics/japan-visa-appointment-slots/page.tsx b/app/topics/japan-visa-appointment-slots/page.tsx index 966cb56..0ed3d35 100644 --- a/app/topics/japan-visa-appointment-slots/page.tsx +++ b/app/topics/japan-visa-appointment-slots/page.tsx @@ -63,9 +63,9 @@ export default function JapanVisa() { This free notification service automatically monitors the Embassy of Japan in Singapore's website for any available booking slots for - visa applications, and sends out email notifications to our subscribers - the moment a slot becomes available. If there are earlier dates - available, you would also be notified. + visa applications, and sends out email or Telegram notifications to our + subscribers the moment a slot becomes available. If there are earlier + dates available, you would also be notified. I created this service because I had the same problem when applying for diff --git a/app/topics/ktm-train-tickets/page.tsx b/app/topics/ktm-train-tickets/page.tsx index 43c117e..695b1ae 100644 --- a/app/topics/ktm-train-tickets/page.tsx +++ b/app/topics/ktm-train-tickets/page.tsx @@ -7,14 +7,15 @@ import { Anchor } from "@/components/ui/anchor"; import Heading from "@/components/ui/heading"; import Subheading from "@/components/ui/subheading"; import Paragraph from "@/components/ui/paragraph"; -import { Routes } from "@/lib/enums"; +import { Routes, TelegramChannel } from "@/lib/enums"; import { META_OPEN_GRAPH, META_TWITTER } from "@/app/shared-metadata"; +import { TELEGRAM_SHORT_URL } from "@/lib/constants"; import { TrainTicketsTable } from "./train-tickets-table"; import { TrainScheduleTable } from "./train-schedule-table"; const title = "KTM Train Tickets"; const description = - "Subscribe to SG Alerts to get notified when there are KTM train tickets available from Singapore to Johor Bahru (JB) and vice versa from Easybooking.com website."; + "Subscribe to SG Alerts to get notified when there are KTM train tickets available from Singapore to Johor Bahru (JB) and vice versa for peak days and time slots directly from KTMB website."; const url = Routes.KtmTrainTickets; export const metadata: Metadata = { @@ -42,7 +43,7 @@ export default function KtmTrainTickets() {
{title} - Receive email notifications when there are{" "} + Get notified when there are{" "} KTM {" "} @@ -50,7 +51,7 @@ export default function KtmTrainTickets() { JB - ) and vice versa. + ) and vice versa for peak days and time slots.
@@ -71,18 +72,17 @@ export default function KtmTrainTickets() { JB {" "} is a popular destination for Singaporeans to visit for shopping, dining - and entertainment. You can either book your train tickets directly from{" "} - - KTM - {" "} - or you can book from{" "} + and entertainment. You can book your tickets online through the{" "} - Easybook.com - {" "} - website. + + KTMB + {" "} + website + + .
Due to the high demand for{" "} @@ -95,15 +95,17 @@ export default function KtmTrainTickets() { time-consuming and frustrating. - SG Alerts can help you to stay - updated with the latest{" "} + SG Alerts monitors the{" "} + + KTMB + {" "} + website directly to help you to stay updated with the latest{" "} KTM {" "} - train tickets availability up to 3 months in advance. We will send you - an email notification when there are new tickets available. This will - save you time and effort from having to check the booking websites - frequently. + train tickets availability. We will send you a Telegram notification + when there are new tickets available. This will save you time and effort + from having to check the booking website frequently. We have identified that Friday evenings, Saturday mornings are the most @@ -121,21 +123,16 @@ export default function KtmTrainTickets() { - To get started, simply click the button below to head over to the - subscription page. Once there, you can select{" "} - - Train Tickets ( - - KTM - - ) - {" "} - as one of the topics you want to subscribe to. + To get started, simply click the button below to subscribe to the + Telegram channel and start receiving notifications.
- + - +
); diff --git a/app/topics/ktm-train-tickets/train-schedule-table.tsx b/app/topics/ktm-train-tickets/train-schedule-table.tsx index 656af9c..a095a4f 100644 --- a/app/topics/ktm-train-tickets/train-schedule-table.tsx +++ b/app/topics/ktm-train-tickets/train-schedule-table.tsx @@ -3,6 +3,7 @@ import { Table, TableBody, + TableCaption, TableCell, TableHead, TableHeader, @@ -13,6 +14,10 @@ import { TRAIN_SCHEDULE_ITEMS } from "@/lib/content"; export function TrainScheduleTable() { return ( + + We monitor these days and time slots from now till the next 38 days. + + Day diff --git a/lib/api-hooks.ts b/lib/api-hooks.ts index b521606..e9ac4b8 100644 --- a/lib/api-hooks.ts +++ b/lib/api-hooks.ts @@ -402,7 +402,7 @@ export function useGetTrainSlotsInfo() { const axios = (await import("axios")).default; const res = await axios.get( - `${API_URL}${ApiEndpoint.TrainTimeSlotsInfo}?service=${TrainService.KTM}` + `${API_URL}${ApiEndpoint.TrainTimeSlotsInfo}?service=${TrainService.KTMB}` ); const resData = res.data; diff --git a/lib/content.tsx b/lib/content.tsx index bb6b285..a468574 100644 --- a/lib/content.tsx +++ b/lib/content.tsx @@ -242,53 +242,33 @@ export const TELEGRAM_PUBLIC_CHANNELS: TelegramPublicChannels = [ ), }, -]; - -export const NOTIFICATION_SETTINGS: NotificationSettings = [ { - id: SubscriptionTopic.CdcLessonsAutoCar, - title: "🚘 CDC Practical Lesson Slots (Class 3A Motorcar)", + id: TelegramChannel.KtmTrainTickets, + title: "🚆 KTM Train Tickets", description: ( <> - Receive email notifications when there are new practical lessons slot(s) - for{" "} - - Class 3A Motorcar - {" "} - at ComfortDelGro Driving Centre. - - ), - hasTelegramChannel: true, - }, - { - id: SubscriptionTopic.CdcEyesightTest, - title: "🚘 CDC Appointment Slots (Eyesight Test)", - description: ( - <> - Receive email notifications when there are new appointment date(s) for - the{" "} - - eyesight test - {" "} - at ComfortDelGro Driving Centre. - - ), - hasTelegramChannel: true, - }, - { - id: SubscriptionTopic.CdcCounterServices, - title: "🚘 CDC Appointment Slots (Counter Services)", - description: ( - <> - Receive email notifications when there are new appointment date(s) for{" "} - - counter services + Receive email notifications when there are{" "} + + + + KTM + {" "} + train ticket(s) + {" "} - at ComfortDelGro Driving Centre. + available from Singapore (SG) to Johor Bahru (JB) and vice versa.
+ + (for SG -> JB: Fridays 5:00 PM onwards, Saturdays before 3:00 PM + only) + {" "} +
+ (for JB -> SG: Sundays 11:30 AM onwards only) ), - hasTelegramChannel: true, }, +]; + +export const NOTIFICATION_SETTINGS: NotificationSettings = [ { id: SubscriptionTopic.SsdcEnrolmentWeekend, title: "🚘 SSDC Appointment Slots (School Enrolment)", @@ -317,21 +297,6 @@ export const NOTIFICATION_SETTINGS: NotificationSettings = [ ), }, - { - id: SubscriptionTopic.SsdcPracticalLessonBooking, - title: "🚘 SSDC Appointment Slots (Practical Lesson Booking)", - description: ( - <> - Receive email notifications when there are new appointment date(s) for - the{" "} - - Class 3 / 3A Practical Lesson Booking - {" "} - at Singapore Safety Driving Centre. - - ), - hasTelegramChannel: true, - }, { id: SubscriptionTopic.SsdcOtherCoursesEnrolment, title: "🚘 SSDC Appointment Slots (Other Courses Enrolment)", @@ -375,7 +340,7 @@ export const NOTIFICATION_SETTINGS: NotificationSettings = [ }, { id: SubscriptionTopic.TrainTicketsKtm, - title: "🚆 Train Tickets (KTM)", + title: "🚆 KTM Train Tickets", description: ( <> Receive email notifications when there are{" "} @@ -396,21 +361,6 @@ export const NOTIFICATION_SETTINGS: NotificationSettings = [ (for JB -> SG: Sundays 11:30 AM onwards only) ), - }, - { - id: SubscriptionTopic.JapanVisaTourism, - title: "🇯🇵 Japan Visa Appointment Slots (Tourism)", - description: ( - <> - Receive email notifications when there are new visa appointment date(s) - for{" "} - - Tourism or Sightseeing - {" "} - at the Embassy of Japan in Singapore.
- (for foreigners who require a visa to visit Japan) - - ), hasTelegramChannel: true, }, { diff --git a/lib/enums.ts b/lib/enums.ts index 88b9019..0ae5207 100644 --- a/lib/enums.ts +++ b/lib/enums.ts @@ -97,7 +97,7 @@ export enum CdcLessonsService { } export enum TrainService { - KTM = "ktm", + KTMB = "ktmb", } export enum JapanVisaType { @@ -123,6 +123,7 @@ export enum TelegramChannel { CdcCounterServices = "SGAlertsCDCCounterServices", SsdcPracticalLessonBooking = "SGAlertsSSDCPracticalLessons", JapanVisaTourism = "SGAlertsJapanVisaTourism", + KtmTrainTickets = "SGAlertsKTMTrainTickets", } export enum TelegramChannelLink {