Showing
1 changed file
with
26 additions
and
0 deletions
| ... | @@ -13,6 +13,19 @@ var fs=require('fs');//파일시스템 사용 | ... | @@ -13,6 +13,19 @@ var fs=require('fs');//파일시스템 사용 |
| 13 | //var param={}; | 13 | //var param={}; |
| 14 | //var urltype=require('url'); | 14 | //var urltype=require('url'); |
| 15 | // | 15 | // |
| 16 | +//class MatchHistory{ | ||
| 17 | +// @SerializedName("matches") | ||
| 18 | +// public List<Matches> matches; | ||
| 19 | +//class Matches{ | ||
| 20 | +// @SerializedName("map") | ||
| 21 | +// public String map; | ||
| 22 | +// @SerializedName("type") | ||
| 23 | +// public String type; | ||
| 24 | +// @SerializedName("decision") | ||
| 25 | +// public String decision; | ||
| 26 | +//} | ||
| 27 | +//} | ||
| 28 | + | ||
| 16 | r.question("분석을 원하는 아이디를 입력하세요 : ",function(answer){//question메소드에서 callback함수 생성 | 29 | r.question("분석을 원하는 아이디를 입력하세요 : ",function(answer){//question메소드에서 callback함수 생성 |
| 17 | console.log("입력완료! 분석중...");//callback함수란 이벤트가 왔을 때 실행되는 함수이다. answer에 검색을 원하는 아이디가 담겨있다. | 30 | console.log("입력완료! 분석중...");//callback함수란 이벤트가 왔을 때 실행되는 함수이다. answer에 검색을 원하는 아이디가 담겨있다. |
| 18 | rtfw1=rtfw1+answer;//검색 url 구성 | 31 | rtfw1=rtfw1+answer;//검색 url 구성 |
| ... | @@ -86,6 +99,19 @@ request(match_history_url,(error,response,body)=>{ | ... | @@ -86,6 +99,19 @@ request(match_history_url,(error,response,body)=>{ |
| 86 | if(error){throw error}; | 99 | if(error){throw error}; |
| 87 | console.log('request3 processing'); | 100 | console.log('request3 processing'); |
| 88 | //console.log(body); //테스트용: response body 출력 | 101 | //console.log(body); //테스트용: response body 출력 |
| 102 | + //JsonParser jsonParser=new JsonParser(); | ||
| 103 | + //JsonObject jsonObject=(JsonObject) jsonParser.parse(json); | ||
| 104 | + //JsonObject matches=(JsonObject) jsonObject.get("matches"); | ||
| 105 | + //System.out.print(matches.get("map")); | ||
| 106 | + | ||
| 107 | +//MatchHistory matchhistory=new Gson().fromJson(json,MatchHistory.class); | ||
| 108 | +//for(MatchHistory.Matches matches : matchhistory.matches){ | ||
| 109 | +// System.out.println(matches.map); | ||
| 110 | +// System.out.println(matches.type); | ||
| 111 | +// System.out.println(matches.decision); | ||
| 112 | +//} | ||
| 113 | +var jsonstring=JSON.stringify(body);//json형식의 string으로 변환 | ||
| 114 | +console.log(jsonstring);//테스트용 : jsontext에 바디가 적절히 들어가는지 검사 | ||
| 89 | });//request3종료 | 115 | });//request3종료 |
| 90 | });//request2종료 | 116 | });//request2종료 |
| 91 | // }catch(error){ | 117 | // }catch(error){ | ... | ... |
-
Please register or login to post a comment