intro#
Recently, with the arrival of the autumn recruitment season, many companies have entered campuses for recruitment presentations. However, not all of these companies are ones that I want to work for. It's a bit troublesome to have to reopen the school's official website every time to see which companies I'm interested in. Therefore, I came up with a solution. I decided to host a calendar subscription on GitHub. Every time I check the official website, I can add the information of the job fairs I want to attend to GitHub. This way, the calendar software will automatically update, and I can also share it with friends who are also job hunting, avoiding the need to repeatedly open and check the same information.
Calendar Subscription#
URL subscription is supported by most calendar software, although a few software like Huawei Calendar do not support it. However, you can still achieve it by downloading third-party calendar software. When the content in the link is modified, the calendar software will automatically update. Therefore, all I need to do is occasionally check the recruitment presentation website to see which companies I'm interested in, and then upload the information to GitHub hosting. All friends who use this shared link will be able to see the information of the new companies.
GitHub Hosting#
Below is a practical tutorial.
- Create a repository. Create a new repository on GitHub. Enter your preferred name in the "Repository name" field, preferably in English. You can fill in the "Description" field as you like or leave it blank. Then click "Create Repository" at the bottom.
- You can write the README file yourself, but I won't create it here. I will directly demonstrate how to write the calendar file.
4. Enter the following format of the file in the "Edit" box. Enter the file name in the "Name your file" field, and it should end with the .ics
format, for example, my_calendar.ics
.
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Example Corp//iCalendar 2.0//EN
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:My Calendar
BEGIN:VEVENT
UID:12345
DTSTAMP:20230901T120000Z
DTSTART:20230910T100000Z
DTEND:20230910T120000Z
SUMMARY:Meeting 1
DESCRIPTION:Discuss project progress
LOCATION:Meeting Room A
END:VEVENT
END:VCALENDAR
- Explanation of the code:
- The
BEGIN:VCALENDAR
andEND:VCALENDAR
tags indicate the start and end of the entire iCalendar file. VERSION
specifies the version of the iCalendar specification.PRODID
identifies the application that generated the iCalendar file.CALSCALE
specifies the scale of the dates, usually GREGORIAN.METHOD
specifies the method of handling calendar data, usually PUBLISH.X-WR-CALNAME
is the name of the calendar.
You only need to modify the calendar name in this section.
- Between
BEGIN:VEVENT
andEND:VEVENT
is the definition of an event. An event includes the following properties:
UID
is the unique identifier of the event.DTSTAMP
is the timestamp of when the event was created or last modified.DTSTART
is the start time of the event.DTEND
is the end time of the event.SUMMARY
is the name or title of the event.DESCRIPTION
is the description of the event.LOCATION
is the location of the event.
This example only includes one event, but you can add more events as needed by repeating the block between BEGIN:VEVENT
and END:VEVENT
, and setting the corresponding properties for each event. The UID
also needs to be modified, and each event should have a unique UID
.
Advanced#
The file above is already functional, but there are two issues that need to be optimized.
- Time zone: The code above uses
UTC
as the default Coordinated Universal Time, which has an 8-hour difference from the Eastern Eight District where we are located. Therefore, we need to change the time to the Eastern Eight District. Modify it as follows:
DTSTART;TZID=Asia/Singapore:20230910T180000 # Use the Asia/Singapore time zone
DTEND;TZID=Asia/Singapore:20230910T200000 # Use the Asia/Singapore time zone
- Inserting links and images: Some calendar software allows you to insert links and covers. We can use this feature to insert the company's official website or application portal and the company's promotional image. Modify it as follows:
DESCRIPTION:<html><img src="https://example.com/image.jpg" alt="Event Image"><br>Discuss project progress</html> \nPlease check for more information: <a href="https://example.com">Link to more information</a>
The link after src
represents the link of the image, and the link after href
represents the link you want to insert.
Import#
After editing the file, click "Commit changes". Finally, open the repository's source code, copy the link at the top, and change blob
to raw
to import it into the calendar software. When you want to add content in the future, simply click the edit button on the right to edit.
To import the calendar, I will use Google Calendar as an example, but the process is similar for other calendar software. Open the calendar, go to settings, select "Add Calendar", choose "Subscribe to URL", and finally enter the link.