Cloud Computing Course
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

125 line
2.9 KiB

3 年之前
3 年之前
  1. #Library_Auto_Seats_Pick
  2. ##For Cloud Computing Course
  3. ###Background
  4. The end of each semester could always evoke the students' enthusiasm for learning, while the library resources of Zhongbei campus are quite worse than Minhang campus, which means there is more competition for seats. And this might cause some students can't reserve a seat for several days.
  5. This project aims to provide automatic seat-grab solutions for students with low screen time, raising the efficiency of seats grabbing.
  6. ###Install
  7. - This project uses Python, Flask, Chrome and Chromedrvier. Go check them out if you don't have them locally installed.
  8. - Install Flask
  9. Open a terminal, make a new folder to store the project. Let's call this folder **autobook**.
  10. If you are using Python 3.6, enter **autobook** and create a virtual environment.
  11. ```shell
  12. python3 -m venv flask
  13. ```
  14. Type these commands one by one to install Flask and its extension.
  15. ```shell
  16. flask/bin/pip install flask
  17. flask/bin/pip install flask-login
  18. flask/bin/pip install flask-openid
  19. flask/bin/pip install flask-mail
  20. flask/bin/pip install flask-sqlalchemy
  21. flask/bin/pip install sqlalchemy-migrate
  22. flask/bin/pip install flask-whooshalchemy
  23. flask/bin/pip install flask-wtf
  24. flask/bin/pip install flask-babel
  25. flask/bin/pip install guess_language
  26. flask/bin/pip install flipflop
  27. flask/bin/pip install coverage
  28. ```
  29. - Install Chrome
  30. ```shell
  31. yum -y install google-chrome-stable
  32. ```
  33. - Install Chromedriver
  34. The version of Chromedriver should be consistent with your Chrome's. If you don't know your Chrome's version, try to type this command to check out.
  35. ```shell
  36. google-chrome --version
  37. ```
  38. Go to this address to find a matching version of Chrome.
  39. http://chromedriver.storage.googleapis.com/index.html
  40. You could download the .zip file to your PC, transfer to your cloud host via Xftp or something else, and unzip it later.
  41. Or you might use this command.
  42. ```shell
  43. wget https://npm.taobao.org/mirrors/chromedriver/83.0.4103.14/chromedriver_linux64.zip
  44. unzip chromedriver_linux64.zip
  45. ```
  46. Just to make sure everything goes well, you might as well type this to avoid possible permission problem.
  47. ```shell
  48. chmod a+x chromedriver
  49. ```
  50. - Other necessary Python modules
  51. Use Pip to install some essential modules.
  52. ```shell
  53. pip3 install pyvirtualdisplay
  54. pip3 install selenium
  55. pip3 install PyEmail
  56. pip3 install gevent
  57. ```
  58. ###Usage
  59. - Deploy
  60. Determine run.py as an executable file.
  61. ```shell
  62. chmod a+x run.py
  63. ```
  64. Run as follows.
  65. ```shell
  66. ./run.py
  67. ```
  68. - Customer use
  69. Visit the website:
  70. http://127.0.0.1:5000/
  71. ###Maintainers
  72. [@Young Hojan](http://gitea.shuishan.net.cn/10195501441)
  73. ###License
  74. [MIT](http://gitea.shuishan.net.cn/10195501441/Library_Auto_Seats_Pick/src/branch/master/LICENSE.md) © Young Hojan