Last active
January 28, 2022 03:21
-
-
Save ilsubyeega/fca07f8c5a3234c5722ee8d488fe46f3 to your computer and use it in GitHub Desktop.
datakr-client-prototype
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Client } from '@datakr/client' | |
import AxiosDriver from '@datakr/axios-driver' | |
import { RequestData, MetroData } from '@datakr/data' | |
const serviceKey = "access_service_key"; | |
const client = new Client(); | |
client.driver = new AxiosDriver(); | |
const result = await client.query(serviceKey, RequestData.from("서울교통공사_서울 도시철도 열차운행시각표", { | |
pageNo: 1, | |
numOfRows: 100, | |
stationCode: MetroData.Station.from("운서").code, | |
week: "DAY", | |
trainDirection: "UP" | |
})); | |
// 혹은 코드 기반 | |
const result = await client.query(serviceKey, RequestData.from(15098251, { | |
pageNo: 1, | |
numOfRows: 100, | |
stationCode: MetroData.Station.from("운서").code, | |
week: "DAY", | |
trainDirection: "UP" | |
})); | |
// result.status.code; result.body; |
@danieluhm2004 이게 좀 눈물나는게
data.go.kr가 API 하나당 토큰 하나이고, typescript completion 기대하고 싶은 코드들이라 ㅇ.ㅇ;
이걸 어떻게 감을 잡아야 될지 몰루
@Alex4386 리뷰점
🤔
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
이런 느낌은 어떠십니까!