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"
},
...
- Install Redis for cache database
- Make a
.env
file with Redis connection details (see.env.example
) - Run Redis server
$ redis-server
- Run server
$ go run .
- 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
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.