Journal

China Agricultural University Automatic Score Reminder System B/S Edition

2010·01·23

Machine-translated from Chinese.  ·  Read original

Half a year ago, I created an automatic score inquiry system. This time, I took the opportunity of the course design to remake the system into a B/S version of the score inquiry system that can self-register and add users in the browser.

In addition to enhancing the functionality, I also rewrote the underlying code entirely. This time, I used Koala Bear’s PyFetion to create the SMS sending function, and the crawling function was changed from the original PHP curl library to Python’s urllib library. As a result, the entire system’s functionality is implemented using only Python, which reduces the difficulty of system deployment. At the same time, I used PHP to write a simple registration system. After deploying the registration system, other students can register and use the system through the network browser, eliminating the need for manual configuration.

Overall System Design Scheme

The entire system uses Python in combination with the urllib library to simulate user login to the student URP education system and access the specified page to obtain the student’s score information for the current semester. It then captures all the HTML code containing the score information. After that, it uses Python to call the Sed text editor under Linux to cut and extract the captured HTML information code, obtaining readable score information. Then, it uses Python in combination with the MySQL library to save the scores to the database.

The Python program also judges whether the scores obtained after this capture are consistent with the previous capture. If they are not consistent, it calls the PyFetion library to log in to Fetion and send an alert SMS. User information is saved in the MySQL database, and user addition is achieved through PHP programs that manipulate the MySQL database.

The web page uses XHTML+CSS+Javascript’s JQuery library to implement. Because AJAX technology is used, the system can provide users with a good operating experience.

The entire system needs to start Apache, MySQL, and judge.py. Among them, Apache and MySQL provide the running environment for the web page, while judge.py uses a loop to scan each registered user in the database and calls the ScoreScanner.py program to determine whether to send an SMS.

Because the course design time is tight, the entire system currently has many shortcomings and areas for improvement. Known issues include:

    1. Currently, users need to provide their own Fetion password when registering, which allows them to send SMS to themselves. The disadvantage of this approach is that personal Fetion passwords are easily leaked, and score inquiries will interfere with normal Fetion use (will cause abnormal disconnections). The next version should be improved to have a single user send SMS to classmates.
    1. The scheduled score inquiry program is relatively simple. This time, because there were problems when using Crontab for delay, I had to abandon Crontab and use Python’s own delay to implement it.
    1. The score conversion part of the sed script still has problems. When encountering certain special courses, it will cause conversion errors.
    1. Lack of user self-management system, and user information cannot be modified after registration.

Project address: http://code.google.com/p/caufetion/

留 · 言