Skip to content

Conversation

@SoggyRhino
Copy link
Contributor

This is to fix the bug where meeting locations were wrong. I tested it the best I could and it I haven't found any problems. The logic mostly the same as the original just less strict with the format of the meeting fields.

Get Meetings

  • Separate meetings based on html divs rather than regex
    • This helps the parser not overrun into the next meeting to find locations
  • Meeting Fields are parsed using Regex Find All String
    • Handles Missing or partial information
  • Location is parsed from the <a> at the bottom of the div
    • Uri is just the href of the <a>
      • If the link doesn't point to a valid building leave location blank
    • Building and number is just the text of the <a> split by space
  • Potential issues:
    • Theoretically we could have a meeting that is all blank since none of the fields are required
      • Still technically correct since the meeting (on coursebook) would just be filled with placeholder data
    • Should meeting days be null or []
      • The json has fields that are null but I thought [] made more sense

Get Academic session (This wasn't part of the bug)

  • The container is essential a map where the key is a <b> and the value next text
  • Switch on the key and set the field of the session based on the value

Parse Time or Panic Helper Method

  • we parse time the same way 4 times in sectionParser so it made sense to make a helper

Everything Else

  • There are some minor changes to accommodate the passing of *goquery.Selection instead of strings
    • Basically just adding a .text to a few methods

I'm not sure why the go.mod changed but that is what was created when I ran the build.bat.

@jpahm
Copy link
Contributor

jpahm commented Feb 22, 2025

This looks great, thank you! I think you handled the potential issues well.

@jpahm jpahm merged commit ba272d9 into UTDNebula:develop Feb 22, 2025
2 checks passed
jpahm pushed a commit that referenced this pull request Feb 22, 2025
* upgraded chromedp version

* fixed room parsing issue for locations

* refactor some lines

* change default meeting days from null to empty list

* minor refactor of getMeetings

* remove redundant lines from getMeetings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants