Git Product home page Git Product logo

ktmuscrap's Introduction

🚀KTMU scrap🚀

Funny little note

  • I acknowledge the shittiness of this code
  • Couldn't fucking care less
  • Not willing to maintain this anymore (but have to)
  • No one pays me for that
  • L + Ratio

🚀 Blazingly fast 🚀, 🚀Memory-safe🚀, 🚀Optimized🚀 HTTP REST API server for 🚀schedule conversion🚀 from 🤮 https://ktmu-sutd.ru 🤮

🚀FAST🚀 Overview

  • Getting daily or weekly schedule's JSON
    1. GET localhost:8080/schedule/daily or GET localhost:8080/schedule/weekly
    2. Enojoy heavily nested and large JSON
    • Or, to get schedule only for one group, use something like GET localhost:8080/schedule/daily?group=<GROUP>
  • Force update with a POST request
    1. Get your temporary key if still didn't: GET localhost:8080/schedule/interact
    2. Request an update: POST localhost:8080/schedule/update?key=<YOUR TEMP KEY>
    3. After some time it'll return a JSON of changes in schedule (or null fields if there aren't any)
  • Subscription to update events using WebSocket
    1. Get your temporary key if still didn't: GET localhost:8080/schedule/interact
    2. WebSocket to localhost:8080/schedule/updates?key=<YOUR TEMP KEY>
    3. Periodically (10 min) it'll send a JSON of changes in schedule (or null fields if there aren't any)

Why use inTeRAKtors and kEYs

To avoid duplicates 🤪

When you are attached to WebSocket events and also make POST update request, you may get the same notify as a WebSocket event AND as an update response 😮

So keys is just a filter to determine if a WebSocket client should receive the notify

Where it's used

ktmuslave is a schedule bot for this server working both in VK and Telegram with some cool features

Probs not useful for anything else except for learning 🤔

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.