Skip to content

Commit

Permalink
implement changes to move ktm train tickets to telegrarm
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicarrojado committed May 4, 2024
1 parent 1560b31 commit 597d338
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 118 deletions.
6 changes: 3 additions & 3 deletions app/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ export default function About() {
</div>
<Paragraph>
<span className="font-medium">SG Alerts</span> is a free notification
service that sends you an email or a Telegram message depending on the
topics you&apos;ve subscribed to. It&apos;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&apos;ve subscribed to. It&apos;s a simple service that
helps you stay up to date with the latest information without having to
constantly check the source website.
</Paragraph>
<Paragraph>
Expand Down
4 changes: 2 additions & 2 deletions app/how-it-works/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export default function HowToUse() {
<Paragraph>
<span className="font-medium">SG Alerts</span> 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.
</Paragraph>
<Paragraph>
Expand Down
6 changes: 3 additions & 3 deletions app/topics/cdc-appointment-slots/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ export default function CdcAppointmentSlots() {
<abbr title="ComfortDelGro Driving Centre" className="no-underline">
CDC
</abbr>
. You will receive an email notification when new appointment slots are
available. If there&apos;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&apos;s an earlier date available, you will also
be notified. You save time and effort by not having to check the{" "}
<abbr title="ComfortDelGro Driving Centre" className="no-underline">
CDC
</abbr>{" "}
Expand Down
6 changes: 3 additions & 3 deletions app/topics/cdc-practical-lesson-slots/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ export default function CdcPracticalLessonSlots() {
</abbr>{" "}
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.
</Paragraph>
<Paragraph>
To get started, simply click the button below to subscribe to the
Expand Down
6 changes: 3 additions & 3 deletions app/topics/japan-visa-appointment-slots/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ export default function JapanVisa() {
<Paragraph>
This free notification service automatically monitors the Embassy of
Japan in Singapore&apos;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.
</Paragraph>
<Paragraph>
I created this service because I had the same problem when applying for
Expand Down
59 changes: 28 additions & 31 deletions app/topics/ktm-train-tickets/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -42,15 +43,15 @@ export default function KtmTrainTickets() {
<div className="space-y-2">
<Heading>{title}</Heading>
<Subheading>
Receive email notifications when there are{" "}
Get notified when there are{" "}
<abbr title="Keretapi Tanah Melayu" className="no-underline">
KTM
</abbr>{" "}
train tickets available from Singapore to Johor Bahru (
<abbr title="Johor Bahru" className="no-underline">
JB
</abbr>
) and vice versa.
) and vice versa for peak days and time slots.
</Subheading>
</div>
<TrainTicketsTable />
Expand All @@ -71,18 +72,17 @@ export default function KtmTrainTickets() {
JB
</abbr>{" "}
is a popular destination for Singaporeans to visit for shopping, dining
and entertainment. You can either book your train tickets directly from{" "}
<abbr title="Keretapi Tanah Melayu" className="no-underline">
KTM
</abbr>{" "}
or you can book from{" "}
and entertainment. You can book your tickets online through the{" "}
<Anchor
href="https://www.easybook.com/en-sg/train/booking/singapore-to-johor"
href="https://shuttleonline.ktmb.com.my/Home/Shuttle"
isExternal
>
Easybook.com
</Anchor>{" "}
website.
<abbr title="Keretapi Tanah Melayu Berhad" className="no-underline">
KTMB
</abbr>{" "}
website
</Anchor>
.
</Paragraph>
<Paragraph>
Due to the high demand for{" "}
Expand All @@ -95,15 +95,17 @@ export default function KtmTrainTickets() {
time-consuming and frustrating.
</Paragraph>
<Paragraph>
<span className="font-medium">SG Alerts</span> can help you to stay
updated with the latest{" "}
<span className="font-medium">SG Alerts</span> monitors the{" "}
<abbr title="Keretapi Tanah Melayu Berhad" className="no-underline">
KTMB
</abbr>{" "}
website directly to help you to stay updated with the latest{" "}
<abbr title="Keretapi Tanah Melayu" className="no-underline">
KTM
</abbr>{" "}
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.
</Paragraph>
<Paragraph>
We have identified that Friday evenings, Saturday mornings are the most
Expand All @@ -121,21 +123,16 @@ export default function KtmTrainTickets() {
</Paragraph>
<TrainScheduleTable />
<Paragraph>
To get started, simply click the button below to head over to the
subscription page. Once there, you can select{" "}
<span className="font-medium">
Train Tickets (
<abbr title="Keretapi Tanah Melayu" className="no-underline">
KTM
</abbr>
)
</span>{" "}
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.
</Paragraph>
<div className="mt-8 text-center">
<Link href={Routes.Home}>
<Anchor
href={`${TELEGRAM_SHORT_URL}/${TelegramChannel.KtmTrainTickets}`}
isExternal
>
<Button variant="secondary">Subscribe Now</Button>
</Link>
</Anchor>
</div>
</Container>
);
Expand Down
5 changes: 5 additions & 0 deletions app/topics/ktm-train-tickets/train-schedule-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import {
Table,
TableBody,
TableCaption,
TableCell,
TableHead,
TableHeader,
Expand All @@ -13,6 +14,10 @@ import { TRAIN_SCHEDULE_ITEMS } from "@/lib/content";
export function TrainScheduleTable() {
return (
<Table className="my-6">
<TableCaption>
We monitor these days and time slots from now till the next 38 days.
</TableCaption>

<TableHeader>
<TableRow>
<TableHead>Day</TableHead>
Expand Down
2 changes: 1 addition & 1 deletion lib/api-hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
92 changes: 21 additions & 71 deletions lib/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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{" "}
<Link href={Routes.CdcPracticalLessonSlots} passHref legacyBehavior>
<Anchor>Class 3A Motorcar</Anchor>
</Link>{" "}
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{" "}
<Link href={Routes.CdcAppointmentSlots} passHref legacyBehavior>
<Anchor>eyesight test</Anchor>
</Link>{" "}
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{" "}
<Link href={Routes.CdcAppointmentSlots} passHref legacyBehavior>
<Anchor>counter services</Anchor>
Receive email notifications when there are{" "}
<Link href={Routes.KtmTrainTickets} passHref legacyBehavior>
<Anchor>
<abbr title="Keretapi Tanah Melayu" className="no-underline">
KTM
</abbr>{" "}
train ticket(s)
</Anchor>
</Link>{" "}
at ComfortDelGro Driving Centre.
available from Singapore (SG) to Johor Bahru (JB) and vice versa. <br />
<small>
(for SG -&gt; JB: Fridays 5:00 PM onwards, Saturdays before 3:00 PM
only)
</small>{" "}
<br />
<small>(for JB -&gt; SG: Sundays 11:30 AM onwards only)</small>
</>
),
hasTelegramChannel: true,
},
];

export const NOTIFICATION_SETTINGS: NotificationSettings = [
{
id: SubscriptionTopic.SsdcEnrolmentWeekend,
title: "🚘 SSDC Appointment Slots (School Enrolment)",
Expand Down Expand Up @@ -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{" "}
<Link href={Routes.SsdcAppointmentSlots} passHref legacyBehavior>
<Anchor>Class 3 / 3A Practical Lesson Booking</Anchor>
</Link>{" "}
at Singapore Safety Driving Centre.
</>
),
hasTelegramChannel: true,
},
{
id: SubscriptionTopic.SsdcOtherCoursesEnrolment,
title: "🚘 SSDC Appointment Slots (Other Courses Enrolment)",
Expand Down Expand Up @@ -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{" "}
Expand All @@ -396,21 +361,6 @@ export const NOTIFICATION_SETTINGS: NotificationSettings = [
<small>(for JB -&gt; SG: Sundays 11:30 AM onwards only)</small>
</>
),
},
{
id: SubscriptionTopic.JapanVisaTourism,
title: "🇯🇵 Japan Visa Appointment Slots (Tourism)",
description: (
<>
Receive email notifications when there are new visa appointment date(s)
for{" "}
<Link href={Routes.JapanVisa} passHref legacyBehavior>
<Anchor>Tourism or Sightseeing</Anchor>
</Link>{" "}
at the Embassy of Japan in Singapore. <br />
<small>(for foreigners who require a visa to visit Japan)</small>
</>
),
hasTelegramChannel: true,
},
{
Expand Down
3 changes: 2 additions & 1 deletion lib/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export enum CdcLessonsService {
}

export enum TrainService {
KTM = "ktm",
KTMB = "ktmb",
}

export enum JapanVisaType {
Expand All @@ -123,6 +123,7 @@ export enum TelegramChannel {
CdcCounterServices = "SGAlertsCDCCounterServices",
SsdcPracticalLessonBooking = "SGAlertsSSDCPracticalLessons",
JapanVisaTourism = "SGAlertsJapanVisaTourism",
KtmTrainTickets = "SGAlertsKTMTrainTickets",
}

export enum TelegramChannelLink {
Expand Down

0 comments on commit 597d338

Please sign in to comment.