npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

uestc

v1.0.0-alpha1

Published

A concise, reliable and powerful SDK platform for UESTC.

Downloads

9

Readme

UESTC SDK / 电子科技大学开发工具包

A concise, reliable and powerful SDK platform for UESTC.

简洁、可靠且功能强大的 UESTC 集成 SDK 平台。

NPM Version Node Version NPM Downloads Linux Build Windows Build Test Coverage

var sdk = require('uestc');
var app = sdk.single();
var user = app.identify('2012019050031', '12345678');

app.searchForPeople('章萌芊', function (people) {
  console.log('全电子科大叫章萌芊的共有' + people.length + '人,分别是:');
  for(var i in people) {
    person = people[i];
    console.log('身份:' + person.metier + ',学院:' + person.deptName + ',学号:' + person.id);
  }
});
// 很遗憾的告诉你真的没有这个人...

user.getCourses(3, 2, function (courses) {
  console.log('上学期的成绩如下:');
  for(var i in courses) {
    var course = courses[i];
    console.log('课程: ' + course.name + ',成绩: ' + course.score + ',学分: ' + course.credit);
  }
});

user.on('consumption', function (err, consumption) {
  console.log('饭卡于' + consumption.time + '在' + consumption.place + '消费了' + consumption.cost + '元');
});

Installation / 安装

Install via Npm / 通过 Npm 安装 :

$ npm install uestc

Install & save to dependency / 安装并将项目添加到依赖库中:

$ npm install uestc --save

Install & save to devDependency / 安装并将项目添加到开发依赖库中:

$ npm install uestc --save-dev

Features / 特性

已有功能:

  • 用户登陆认证
  • 学校的课程信息条件查询
  • 学校的人员信息关键字查询
  • 用户学籍信息获取
  • 用户课程成绩信息获取
  • 用户课程表信息获取
  • 用户考试信息获取
  • 考试安排、学科成绩事件推送
  • 数据缓存,支持离线访问

预计增加功能:

  • 教务处公告获取(不急,辅导员和班委会塞给你的)
  • 一卡通消费信息查询(不急,有喜付了)
  • 图书馆图书信息查询(不急,有官方APP)
  • 一卡通消费、教务处通知事件推送(见上面)
  • 教务系统自动评教(现在拿不到接口)
  • 选课系统退补选时自动实时抢课(现在拿不到接口)

Docs / 文档

Quick Start / 快速入门

由于整个项目的接口较为简单,可直接参考 官方文档

Philosophy / 设计理念

A Project for the sake of all Project.

由于在日常的学习生活中有大量的项目(比如通信学院的 P2P)等都需要用到学校的一些网站(尤其是教务系统), 以及一些平台也往往需要验证用户的电子科技大学学生身份等。

而绝大多数人都是直接开始从零造车子,目前还没有见到任何组织或个人有造轮子的计划,效率及其低下。 虽然也有部分同学开源的一些相关项目(如教务系统爬虫等,可以在 GitHub 中搜索 uestc ), 但大都功能单一,且都为独立项目不利于重复利用。

从而构想出将学校网站所有功能抽离成独立 SDK 的理念,对外提供友好的 API ,将其与项目的业务逻辑相分离,从而高效化项目开发过程, 专心于业务逻辑本身,也能够让项目更利于维护和扩展。

初版 SDK 仅进行了 NodeJS 版本的开发,后续根据需求及现实情况可能继续开发 Ruby、Python、Java、C# 版本, 仍然会按照现有的文档设计接口(其他语言可能大多采用同步函数接口,JS 版采用异步函数接口主要基于语言本身的原因), 如果有意愿共同开发其他语言版本的可以联系作者。

项目会随着官方接口的变更而(不一定及时的)更新,如果遇到了不正常运行的情况可以在 Issue 中提出或直接请求 Pull Request , 如果有任何功能或其他方面的意见或建议也欢迎提出。

如果有对项目本身的实现,或项目架构以及测试方法感兴趣的同学,也欢迎联系。

Prospect / 用途

  • 作为第三方登陆支持库,以验证电子科大学生身份。
  • 作为微信服务器支持库,可以快速查询相关信息并实现推送。
  • 作为移动端服务器支持库,可以快速打造掌上校园等校园客户端。
  • 作为参考代码,了解学校各个接口的相关细节信息(项目开源,可随意使用)。
  • 作为参考代码,学习 NodeJS 项目的开发(水平有限,还怕误导)。

Examples / 示例

由于整个项目的接口较为简单,可直接参考 官方文档

Tests / 测试

如果需要运行测试,首先需要安装相应的依赖项,然后运行测试命令:

Unit tests / 单元测试:

$ npm install
$ npm test

Coverage / 代码覆盖率测试:

$ npm install
$ npm run test-ci

Developer / 开发人员

本项目目前由 Trotyl Yu 独立开发。

贡献者清单

License / 许可协议

MIT