views:

48

answers:

0

I am trying to create a multithreaded PHP script that POSTs the USN (University Seat Number) to the university results website and then indexes the result. Please give me the plot to do so. I started learning PHP a month ago. please do read the following:

  1. Valid USN regex is /^([12347]{1})([a-zA-Z]{2})([0-9]{2})([a-zA-Z]{2})([0-9]{3})$/ EX:- 1sj05ec007 where 1 is the region code, sj is the college code, 05 is the year of admission, ec is the branch code, 007 is the roll number.

  2. The script checks result of each USN in a range and it should stop checking anymore results of the same college and branch once the website shows error (I mean invalid USN) for N number of consecutive USNs.
    EX:- 1sj05ec001 to 1sj05ec129 are valid USNs and it has to stop once after checking 1sj05ec134 if N=5.

  3. If a student has a backlog (failure) in previous semesters then the result page shows the result of the previous semesters also. So the script has to check the number of semesters being displayed and get the result separately for each semester.

Additional information:

  1. website of the university results http://results.vtu.ac.in
  2. a few valid USNs 1nc08cs001, 1sj09cs001, 1nc07cs002
  3. a few invalid USNs 1nc09cs160, 1sj08ec178, 1sj07me189
  4. a USN without backlogs 1nc09cs023
  5. a USN with a backlog 1nc09cs065

Things I have done so far:

  1. Get the result page for a USN using PHP cURL.
  2. Validate the USN using the regex above.

Things I need a plot for:

  1. Extracting the name, USN, subject, marks, result from the result page and storing in a database.
  2. Checking for the number of semester results being displayed (I have done it using regex but please tell me if there is better option).
  3. Stop checking after N consecutive invalid USNs.
  4. And finally multi-threaded checking and indexing.

I know that this is really big to read but thanks for reading. :)