Add initial parsing

This commit is contained in:
Jared He 2021-06-03 07:35:58 -05:00
parent 690e519d81
commit 43168b0db9
4 changed files with 98 additions and 0 deletions

View File

@ -0,0 +1,21 @@
export const metadata = {
name: "Afterhours: Personal Relationships",
short: "Learn how React works and make your own version!",
date: new Date("2021-03-02 2:00 PM"),
online: false,
location: "MC",
registerLink: "http://csclub.uwaterloo.ca/",
};
The past year has been tough for all of us, having to deal with the pandemic
while studying or working remotely. If you've felt that meeting new people and
sustaining relationships with others has never been more challenging, we feel
that too, and we want to talk about it.
CSC brings you the third chapter of Afterhours, and this time we're discussing
Personal Relationships. Join us for a chat about how our relationships
(platonic and romantic) have been affected, whether that be due to co-op,
sequence changes, or COVID. We'll be sharing our own personal stories and we'd
love for you all to join in on the discussion.
Registration is required for attendance, so don't miss out!

View File

@ -0,0 +1,36 @@
<eventitem date="2021-05-24" time="7 PM" room="Online" title="CSC x SE Soc: Interview Prep">
<short>
<p>CSC and SE Soc are hosting an Interview Prep Workshop next week! Join Kristy Gao and Bimesh De Silva as they review the interview process, from behavioural to technical interviews. They'll finish off with live mock interviews, and the event will be held on Twitch (https://www.twitch.tv/uwcsclub).</p>
</short>
<abstract>
<p>Browsing through your unsolved Leetcode problems? Flipping open CTCI for the first time? Have no clue what to expect from a technical interview or just need an interview refresher? </p>
<p>We've got you covered at our CSC x SE Soc Interview Prep Workshop this Monday, May 24th from 7:00-8:30pm ET! Live-streamed on Twitch, Kristy Gao and Bimesh De Silva will be walking through important aspects of the interview process from coding challenges to behavioural interviews to algorithmic interviews, go through some live mock interviews, and share their tips and techniques along the way!</p>
<p>Registration isn't required, we'll just be sending you an email reminder, as well as inviting you to our calendar event!</p>
<p>The event will be hosted on Twitch at <a href="https://www.twitch.tv/uwcsclub">https://www.twitch.tv/uwcsclub</a></p>
<p>Register at <a href="http://bit.ly/csc-sesoc-interview-prep-signup">http://bit.ly/csc-sesoc-interview-prep-signup</a>!</p>
</abstract>
</eventitem>
<eventitem date="2021-05-17" time="8:00 pm" room="Online" title="CSC BOT &#38; Game Night">
<short>
<p>
Learn about our plans for the term and play some games with us.
</p>
</short>
<abstract>
<p>Kick off your Spring term with CSC! Come join us on Discord to learn more about what we'll be up to this term and how you can participate!</p>
<p>Afterwards, stick around for a relaxing and fun game night. See you there!</p>
<h1>Here, I am also testing with</h1>
<h2>Many headings, as well as <strong>bold text</strong> and <i>italics</i>.</h2>
<h4>More headings</h4>
<ul>
<li>One</li>
<li>Unordered</li>
<li>List</li>
</ul>
<ol>
<li>One</li>
<li>Ordered</li>
<li>List</li>
</ol>
</abstract>
</eventitem>

View File

@ -0,0 +1,27 @@
const converter = new showdown.Converter();
fetch("./event-test.xml")
.then((response) => response.text())
.then((jsonResponse) => parseXML(jsonResponse))
.catch((error) => console.error(error));
const parseXML = (XML) => {
const eventItemRegex = /<eventitem.*>(.|\n)*?<\/eventitem>/g;
const shortRegex = /(?<=<short>)(.|\n)*?(?=<\/short>)/g;
const abstractRegex = /(?<=<abstract>)(.|\n)*?(?=<\/abstract>)/g;
let eventItems = [];
// Find how many eventItems there are here
while ((eventItems = eventItemRegex.exec(XML)) !== null) {
shortRegex.lastIndex = 0
abstractRegex.lastIndex = 0
const eventItem = eventItems[0];
console.log(eventItem);
let short = shortRegex.exec(eventItem);
console.log(converter.makeMarkdown(short[0]));
let abstract = abstractRegex.exec(eventItem);
console.log(converter.makeMarkdown(abstract[0]));
}
};

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.jsdelivr.net/npm/showdown@1.9.1/dist/showdown.min.js"></script>
<script src="news-conversion.js"></script>
<title>Document</title>
</head>
<body>
</body>
</html>