Skip to content

Adapting the Program to Another Department

Kees Wolterstorff edited this page Apr 26, 2024 · 6 revisions

Changing the Department

This will be a difficult task, as the fact that it uses the physics website is baked into the program itself, but it is not impossible. You will have to be mindful about what you change, otherwise it will result in an inoperable program. The following are the variables you will need to change in order to make this work for a different department, by class file.

Consistency Checks

In the Physics department, we like to have the syntax of the title be [Lecture Type] | [Title] and the speaker be [Name], [Position] ([Affiliation]). I have it setup to check if the title is missing the | character, and hence flags it, similarly with parentheses in the speaker line. Adapt these to whatever you can see that would identify an error in the formatting. This is found in the GenerateWordDocument.cs file.

Program.cs

string eventsUrl = "http://events.umich.edu/group/1965/rss?v=2&html_output=true"

This is the link to the RSS feed listed on the Physics website under all-events. Change this to the RSS feed of whatever department you'd like.

Methods.cs

return new System.Uri("https://lsa.umich.edu/physics/news-events/all-events.detail.html/" + uriSubstring + ".html");

This is found within the FetchEventUri method, and is used to get the Url of the event that links to our website, instead of just Happenings. The uriSubstring is a string of 15 characters, 6 numbers followed by a hyphen and 8 more numbers. The first 6 numbers refer to the event itself, I'm not quite sure what the other 8 are, but they are required to have in order to link to the Physics website. I can't quite recommend anything other than look at any event, and see if you can locate something like this in the Url: 121522-21846666, and change the Url I have accordingly.

e.DateUri = new System.Uri("https://lsa.umich.edu/physics/news-events/all-events.html#date=" + date + "&view=day");

This is found within the AssignDate method, and is used to get the Url of the day, as we typically display the date with a hyperlink connected to our website's events page, specifically that day's. Again, I can't recommend anything in particular other than selecting a day under the all events tab, and look at the Url to see how it differs from the one I have here, and change it accordingly.

GenerateWordDocument.cs

string stringHeader = "Physics Seminars and Colloquia ~ " + startDate.ToString("m", CultureInfo.CreateSpecificCulture("en")) + "-";

This creates the header for the document, typically formatted like this: "Physics Seminars and Colloquia ~ April 22-27, 2024." Adjust the wording however you'd like.

if (e.Speaker.Contains("(") == false | e.Speaker.Contains(")") == false) { runPropertiesSpeaker.Append(highlightSpeaker); }

Adapt this how you see fit.

if (e.Title.Contains("|") == false) { runPropertiesTitle.Append(highlightTitle); }

Adapt this how you see fit.

Clone this wiki locally