Parsing the Output

After sending a CGI request message for each page of the schedule for each bus, the Port Authority web server sends back the HTML for their results page:
  • My parser reads each incoming character and places it into a rotating buffer. Once the words "Forbes / Oakland" appear at the end of the buffer, the program checks a specific character location near the beginning of the buffer for the time. (This is a primitive and unreliable way to parse the data and will have be changed if the Port Authority changes the format of their output page... this should be improved with a new version of the code.)
  • The time is converted to military time for comparison of the current time.
  • This is done until the first time appears in the HTML file that's later than the current time.
  • This is the result for the bus line that's being checked.