Giter VIP home page Giter VIP logo

api-sut-reg's Introduction

API ระบบ REG SUT

alt text


- สิ่งที่ใช้ได้
  • ดึงข้อมูลโดยรหัสวิชา
    • ชื่อวิชา
    • หน่วยกิต
    • จำนวนกลุ่ม
    • เวลาเรียน
    • รายละเอียดต่างๆ เช่นวันที่สอบ อาจารย์ผู้สอน

- เกี่ยวกับไฟล์
  • File Data/courseid.json
    • สำหรับเก็บข้อมูล courseid และ coursecode
      • courseid หมายถึง ID ที่ใช้ในการ Query ข้อมูลรายวิชา
      • coursecode หมายถึง รหัสวิชา โดยการค้นหาจะอ้างอิงไปถึง courseid
  • File api.php
    • เดะว่างๆมาเขียนนาคร้าบ ^^
  • File Lib/simple_html_dom.php
    • คือ php dom (Document Object Model) แต่เป็นไลบรารี่ที่มีคนพัฒนาไว้แย้ว
      • ใช้สำหรับดึง content หน้า reg เป็น html แล้ว.....
    • Github N|Solid

How to use

การดึงข้อมูล

  • แบบเต็ม

    • การดึงรายระเอียดวิชา ?id=รหัสวิชา&acadyear=ปีการศึกษา&semester=ภาคการศึกษา Example: www.snailbot.xyz/api.php?id=523101&acadyear=2560&semester=3
  • แบบย่อ

 /get/#a/#b/#c
 #a = รหัสวิชา
 #b = ปีการศึกษา
 #c = เทอม

Example: www.snailbot.xyz/get/532101/2560/3

link test


กรณีไม่พบรายวิชา

กรณีที่ไม่พบรายวิชาอาจเกิดจากไฟล์ json ที่เก็บรหัสรายวิชาไม่ได้มีการอัปเดท หรือไม่มีรหัสวิชาให้ทำการ Insert รหัสวิชา ดังตัวอย่างต่อไปนี้ /insert/รหัสวิชา/ปีที่รายวิชานั้นเปิดสอน

Example: www.snailbot.xyz/insert/532101/2560 Example: https://snailbot.xyz/mn.php?id=523101&y=2560

กรณีเพิ่มข้อมูลสำเร็จ
{
"status":"success",
"code":1,
"coursecode":"1003564",
"courseid":"523101"
}
กรณีที่มีรหัสในไฟล์ json แล้ว
{
"status":"has in table",
"code":2
}
กรณีไม่พบไฟล์

Facebook --Moomdate--

api-sut-reg's People

Contributors

moomdate avatar nlgrf 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.