Giter Site home page Giter Site logo

wwyqianqian / requests-ccnu Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 0.0 5.7 MB

Personal scripts of enrolling in CCNU optional courses. Or find your friends via a public website API. More ……

License: GNU General Public License v2.0

Python 48.60% JavaScript 24.77% HTML 26.63%
python-requests icalendar icalendar-rfc login-simulation

requests-ccnu's Introduction

requests-ccnu

脚本简介

本仓库是 CCNUer 日常生活必备的小脚本集合。多是利用 py3 的 requests 库写出的,模拟登录学校网站后,进行您想要的查询和适度的爬取。实现很简单,点子更重要,欢迎校友提 PR。

现已完成:

  • ccnu2ical.py, ccnu2ical.js

    前者通过处理 JSON、后者通过爬取 HTML 结构来获取学生课程表,并按照 RFC 文档把课表改写为.ics 格式的日历文件。同学们可自行导入谷歌日历或 iCloud 等等支持 .ics 格式的系统日历,从此告别每学期一度的手动输入。当前版本号:v0.5.0。

  • courses.py

    选课脚本,现阶段由于教务处取消了「抢课」环节,故失效,剩余部分代码结构仅供学习参考。

  • spocDownloader.py

    云课堂下载器。学校新版云课堂前端没有给出「下载」按钮,同学们无法直接下载 PPT、论文等课件,而之前的旧版云课堂有这个功能,很多同学产生了依赖,于是这是个比较大的需求。

    目前此脚本通过模拟登录 spoc 网站,发送请求获取后端数据,拿到了特征,最后通过 URL 拼接,找到了文件真正的下载链接。这个脚本可以爬取到指定课程的所有文件,同学们可以按照个人需求手动下载。当前开发版本号:v0.5.0。

  • spocFriends.py

    学校开放的好友搜索平台。目前支持输入学号范围,批量查询同学姓名。爬取照片由于属于隐私范畴,遂不做。

使用方法

ccnu2ical.js

登录教务管理系统,打开学生课表查询页面,待网页显示课表后,右键进入审查元素(inspect),在 console 中粘贴ccnu2ical.js 里面的代码。回车后,即可下载到.ics 格式的日历文件。此 js 代码段由友人 @SumiMakito 贡献,十分感谢。

ccnu2ical.py

git clone https://github.com/wwyqianqian/requests-ccnu.git	
pip install requests
python3 ccnu2ical.py

目前是运行前需要手动输入 cookie,未来计划改写为模拟登录形式。

spocDownloader.py

git clone https://github.com/wwyqianqian/requests-ccnu.git	
pip install requests
python3 spocDownloader.py

按照提示,模拟登录需要输入学校云课堂网站真实的学号密码,以及下载页面的部分 url (Site ID) 。

效果演示

  • 云课堂资源下载效果演示:

    spoc.png

  • 通过 iCloud 帐号同步课表:

  • 通过谷歌帐号同步课表:

友情链接

requests-ccnu's People

Contributors

wwyqianqian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

requests-ccnu's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.