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

run-away-from-sdu

v1.0.2

Published

山大? 快润! 山东大学一键申请出校脚本

Downloads

7

Readme

山东大学 一键申请出校脚本 开润神器

workflow

npm version

本脚本旨在为沙袋师生提供更便捷和稳定的山东大学信息中心出校申请服务

( 说白了就是免去每次出校都要填写繁琐的表单,一键用上次提交出校申请的信息再帮你申一次

仅备案制出校时可用 (其实审批制也可以,不过都审批制了也没必要

济威青一校三地均可用 (理论上来说是这样的,不能用请提 issue

使用方法

1. CLI 命令行直接运行

安装 Nodejs 后,运行以下命令即可:

npx run-away-from-sdu <userId> <password> <date> [endDate]

参数说明:

userId 山大统一身份认证账号

password 山大统一身份认证密码

date 申请出校日期, 例: 2022-07-10

endDate 可选. 若填写, 则会批量申请至截止申请日期. 例: 2022-07-10

2. 作为 npm 包在 node 代码中引入

import submitGooutApplication, {
  batchSubmitGooutApplication,
} from 'run-away-from-sdu';

const app = async () => {
  console.log('提交单次出校申请: ');
  await submitGooutApplication(
    '学号',
    '密码',
    moment(date, 'YYYY-MM-DD').valueOf()
  );
  console.log('申请成功!');

  console.log('批量提交指定日期范围内的出校申请: ');
  await batchSubmitGooutApplication(
    '学号',
    '密码',
    moment(startDate, 'YYYY-MM-DD').valueOf(),
    moment(endDate, 'YYYY-MM-DD').valueOf(),
    // 每提交一天的申请后的回调函数,如果传入的是Async异步函数则会等待该函数执行完毕再提交下一天的申请
    (dateTimeStp, success, error) =>
      success
        ? console.log(`${moment(dateTimeStp).format('YYYY-MM-DD')} 申请成功`)
        : console.error(
            `${moment(dateTimeStp).format('YYYY-MM-DD')} 申请失败`,
            error
          )
  );
  console.log('批量申请完毕');
};

3. 使用小程序的每日定时申请服务

Crazyherlab

原理&大致流程

~~示意图以后再补~~

先用账号和密码去登录山大统一身份认证平台,跳转到山大信息化公共服务平台拿到对应的登录态 Cookie。

然后从服务中心获取并处理得到最新的出入校园申请的表单模板,对模板稍加修改并替换日期后得到本次请求的表单数据。

用这份表单数据向信息办的接口提交出校申请即可。