Code Monkey home page Code Monkey logo

drcom-cli's Introduction

drcom-cli

node.js script to automate Dr.Com authentication.
primarily for NJUPT, should work fine for others

Install

npm install -g wacky6/drcom-cli

Usage - CLI

drcom-cli server cmd [args]

server

Dr.Com server's hostname
the one in address bar when get redirected to login portal

cmd / args
cmd args
login username password
logout [none]
status [none]
  • username: Dr.Com account, usually student card's ID
  • password: Dr.Com password, usually last 6 digits of resident ID

Usage - daemon

  1. write account/password to /etc/drcom-account.conf (you can change that in drcom-daemon.js)
  2. start daemon using the launcher you like (PM2, forever, ...)

Example of drcom-account.conf

Account on the left, Password on the right

110201300000000 123456
110201400000000 654321

Internals

Checks login/logout status by requesting a probe url, every minute, if gets 30x redirection, it means logged out

Default:

  • probe-url: http://www.bing.com
  • interval: 60*1000 ms (1 minute)

Change interval: modify setInterval in drcom-daemon.js
Change probe: modify this.probe in drCom.js

Note

This script only works if Dr.Com server allows web portal login.
Works by running RegExp matches against returned HTML, may not be consistent all the time!

drcom-cli's People

Contributors

wacky6 avatar

Watchers

 avatar  avatar

Forkers

neo0

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.