banner
0xMech

0xMech

Focus on various AI application sharing, Blockchain learners, web3 new leeks
twitter

Manage calendar subscriptions through GitHub.

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 we want to apply to. It can be troublesome to open the school's official website every time to check which companies we are interested in. Therefore, I came up with a solution: hosting a calendar subscription on GitHub. By adding the information of the recruitment events we want to attend to GitHub whenever we check the official website, we can automatically update the calendar software and share it with friends who are also job hunting, thus avoiding the need to repeatedly open and check the website.

Calendar Subscription#

URL subscription is supported by most calendar software, although a few software like Huawei Calendar do not support it. However, this can still be achieved by downloading third-party calendar software. When the content in the link is modified, the calendar software will automatically update. Therefore, I only need to occasionally check the official website for recruitment presentations by companies that I am interested in, and then upload the information to GitHub hosting. All friends who use the shared link can see the information of new companies.

GitHub Hosting#

Below is a practical tutorial:

  1. Create a repository: Create a new repository on GitHub. Fill in your preferred name in the "Repository name" field, preferably in English. You can also fill in a description in the "Description" field, or leave it blank. Then click "Create Repository" at the bottom.

Create Repository

  1. Readme file: You can write your own readme file, but I will skip this step and directly demonstrate how to write the calendar file.

Create File
4. In the "Edit" box below, enter the following format of the file. 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:Event 1
DESCRIPTION:Discuss project progress
LOCATION:Meeting Room A
END:VEVENT

END:VCALENDAR

  1. Explanation of the code:
  • The BEGIN:VCALENDAR and END tags represent 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 processing calendar data, usually PUBLISH.
  • X-WR-CALNAME is the name of the calendar.

Only the calendar name needs to be modified here.

  1. Between BEGIN and END 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.

Input

This example only includes one event, but you can add more events as needed by repeating the block between BEGIN and END, 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:

  1. Time zone: The code above uses UTC as the default, which has an 8-hour difference from the East 8th time zone where we are located. Therefore, the time needs to be changed to the East 8th time zone. 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
  1. Inserting links and images: Some calendar software allows the insertion of links and covers. We can utilize this feature to insert the official website or application portal of the company 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 to the image, and the link after href represents the link to be inserted.

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. To add more content in the future, click the edit button on the right to edit.

Link

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 "From URL", and enter the link.

Import

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.