Showing
1 changed file
with
18 additions
and
0 deletions
busterm_control.js
0 → 100644
1 | +var request = require("sync-request"); | ||
2 | +var station_servicekey = "8X6B2qUgjGCX4APyGjxTH13yYqgEFZ2jaGus469okviEDTS3TmlEFg6uyfW9I45HjBZQuzfXXHTDpr1bPfp3rA%3D%3D"; | ||
3 | +var keyword_bus_number = "1112"; | ||
4 | + | ||
5 | +var obj = ["1112","7000","9","5100","1560"]; | ||
6 | +var route_station_url = "http://openapi.gbis.go.kr/ws/rest/busrouteservice"; | ||
7 | +var busarrival_station_url = "http://openapi.gbis.go.kr/ws/rest/busarrivalservice"; | ||
8 | +var serviceKey_string = "?serviceKey="+station_servicekey+"&"; | ||
9 | + | ||
10 | +for(var i = 0; i<obj.length; i++) { | ||
11 | + var keyword_parameter = "keyword="+obj[i]; | ||
12 | + console.log(keyword_parameter); | ||
13 | + var uris = route_station_url+serviceKey_string+keyword_parameter; | ||
14 | + var res = request('GET', uris); | ||
15 | + var gotData = res.getBody().toString(); | ||
16 | + console.log(gotData); | ||
17 | + | ||
18 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment