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:
Valid USN regex is
/^([12347]{1})([a-zA-Z]{2})([0-9]{2})([a-zA-Z]{2})([0-9]{3})$/
EX:- 1sj05ec007
where1
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.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
to1sj05ec129
are valid USNs and it has to stop once after checking1sj05ec134
ifN=5
.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:
- website of the university results http://results.vtu.ac.in
- a few valid USNs
1nc08cs001
,1sj09cs001
,1nc07cs002
- a few invalid USNs 1nc09cs160,
1sj08ec178
,1sj07me189
- a USN without backlogs
1nc09cs023
- a USN with a backlog 1nc09cs065
Things I have done so far:
- Get the result page for a USN using PHP cURL.
- Validate the USN using the regex above.
Things I need a plot for:
- Extracting the name, USN, subject, marks, result from the result page and storing in a database.
- Checking for the number of semester results being displayed (I have done it using regex but please tell me if there is better option).
- Stop checking after
N
consecutive invalid USNs. - And finally multi-threaded checking and indexing.
I know that this is really big to read but thanks for reading. :)