GithubHelp home page GithubHelp logo

elearnping-go's Introduction

E-learnping! Server

A web server for querying updates on BKeL.

$ curl \
    --location --request GET 'https://elearnping-go.fly.dev/api/sites' \
    --header 'Authorization: Bearer abc123xyz456' \

[
    {
        "site": {
            "id": 62848,
            "fullname": "C\u1ea5u tr\u00fac r\u1eddi r\u1ea1c cho khoa h\u1ecdc m\u00e1y t\u00ednh (CO1007)_Video",
            "groupid": 173774
        },
        "from": "2022-05-07T19:00:00+07:00",
        "to": "2022-05-15T23:36:01.045185994+07:00",
        "updates": [
            {
                "module": {
                    "id": 803748,
                    "name": "Conditional Prob 1",
                    "modname": "quiz"
                },
...

Instruction

  1. Install Redis for cache database
  2. Make a .env file with Redis connection details (see .env.example)
  3. Run Redis server
$ redis-server
  1. Run server
$ go run .
  1. Make GET requests to server, with your moodle token as Bearer token on Authorization header.
$ curl \
    --location --request GET 'localhost:8080/api/sites' \
    --header 'Authorization: Bearer {{YOUR_MOODLE_TOKEN_HERE}}' \
    | python3 -m json.tool

Where to find your Moodle token?

Login into e-learning site. Inside the menu on the arrow left of your avatar, click "Tùy chọn"

Click "Security keys".

Your token is the "Moodle mobile web service" one.

elearnping-go's People

Contributors

iceghost avatar

Watchers

 avatar

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.