GithubHelp home page GithubHelp logo

mrandika / km-logbook-exporter Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 4 KB

Ever tired copying all logbook data from KM portal to your laporan akhir? Use this.

Python 100.00%
kampus-merdeka logbook

km-logbook-exporter's Introduction

Kampus Merdeka Logbook Exporter

Ever tired copying all logbook data from KM portal to your laporan akhir? Use this.

Getting the logbook data

  1. Login to the Kampus Merdeka Portal
  2. Select the "Kegiatanku", then "Kegiatan Aktif"
  3. Select the activity for which logbook you'd like to export
  4. The URL should be https://kampusmerdeka.kemdikbud.go.id/activity/active/<ACTIVITY_ID>
  5. Note the ACTIVITY_ID
  6. Run the following script in dev console to get your KM bearer token:
const userLocalKey = `@mkbm/manager/user`;
const storageData = localStorage.getItem(userLocalKey);
const storageDataParsed = JSON.parse(storageData);
const token = storageDataParsed?.value?.token;

console.log(token)
  1. Note the output, this will be your KM Token
  2. Run the following script: Logbook Downloader, input the ACTIVITY_ID and BEARER_TOKEN from previous step

... or you can use Postman to import the cURL:

curl --location --request GET 'https://api.kampusmerdeka.kemdikbud.go.id/studi/report/allweeks/{ACTIVITY_ID}' \
--header 'Accept: */*' \
--header 'Authorization: Bearer {BEARER_TOKEN}' \
--header 'Sec-Fetch-Site: same-site' \
--header 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \
--header 'Accept-Encoding: gzip, deflate, br' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Host: api.kampusmerdeka.kemdikbud.go.id' \
--header 'Origin: https://kampusmerdeka.kemdikbud.go.id' \
--header 'Connection: keep-alive' \
--header 'Referer: https://kampusmerdeka.kemdikbud.go.id/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Priority: u=3, i
  1. The file from step 8 should be in your home folder (~/km-logbook-<ACTIVITY_ID>.json)

Exporting to XLSX

  1. Please note your logbook json file path. The following script assumes the json file and the script are in same level.
    - km-logbook-12345678.json
    - logbook-exporter.py
    
  2. Run the following script: Logbook Exporter, input the ACTIVITY_ID
  3. The file from step 1 should be in your home folder (~/km-logbook-<ACTIVITY_ID>.xlsx)

km-logbook-exporter's People

Contributors

mrandika avatar

Stargazers

 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.