China Agricultural University Automatic Score Reminder System B/S Edition
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 from scratch. This time, I used PyFetion from KeKeXiong to implement the SMS sending function, and the crawling function was changed from PHP’s 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 system and access the specified page to obtain the student’s score information for this semester. It then captures 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 crawl are consistent with the previous crawl. If they are not consistent, it calls the PyFetion library to log in to FeiXin and send an alert SMS. User information is saved in the MySQL database, and user addition is implemented through PHP programs that manipulate the MySQL database.
The web page uses XHTML+CSS+Javascript’s JQuery library to implement. Because it uses AJAX technology, the system can provide users with a good operating experience.
To start the entire system, you need 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.
Due to the tight schedule of the course design, the entire system currently has many shortcomings and areas for improvement. The known issues include:
- Currently, users need to provide their own FeiXin password when registering, which allows them to send FeiXin messages to themselves. The disadvantage of this approach is that personal FeiXin passwords are easily leaked, and score inquiries will interfere with normal FeiXin usage (causing abnormal disconnections). The next version should be improved to allow a single user to send FeiXin messages to classmates.
- The scheduled score inquiry program is relatively simple. This time, because there were always problems when using Crontab for delayed execution, I finally had to abandon Crontab and use Python’s own delay to implement it.
- The Sed script in the score conversion part still has problems. When encountering certain special courses, it will cause conversion errors.
- There is a lack of a user self-management system, and user information cannot be modified after registration.
Project address: http://code.google.com/p/caufetion/
还没有人留言,在下面说两句吧。