Journal of Applied Mathematics / 2014 / Article / Alg 1

Research Article

REST-MapReduce: An Integrated Interface but Differentiated Service

Algorithm 1

Open API parser.
Object1  obj1;
String  strSearchKeyword  =  getParameter(STR_PARAM_SEARCHKEYWORD);
String  strWebSvcQuery  =  "http://openapi.naver.com/search?key=test&query=";
strWebSvcQuery  +=  strSearchKeyword  +  "&target=adult";
URL  text  =  new  URL(strWebSvcQuery);
XmlObjectConversionFactory  objCreator  =  XmlObjectConversionFactory.newInstance();
XmlObjectConverter  xoConverter  =  objCreator.newConverter();
obj1  =  xoConverter.setInput(  text.openStream(),  null  );
if  (obj1.getbAdult())  {
return;
}
else  
{
try{
strWebSvcQuery  =  "http://openapi.naver.com/search?key=test&query=";
strWebSvcQuery  +=  strSearchKeyword  +
"&display=10&start=1&target=webkr";
URL  text  =  new  URL(strWebSvcQuery);
String  test  =  text.toString();
XmlPullParserFactory  parserCreator  =  
XmlPullParserFactory.newInstance();
XmlPullParser  parser  =  parserCreator.newPullParser();
parser.setInput(  text.openStream(),  null  );
String  tag;
int  parserEvent  =  parser.getEventType();
while  (parserEvent  !=  XmlPullParser.END_DOCUMENT  ){
switch(parserEvent){
case  XmlPullParser.TEXT:
tag  =  parser.getName();
break;
case  XmlPullParser.END_TAG:
tag  =  parser.getName();
break;
case  XmlPullParser.START_TAG:
tag  =  parser.getName();
break;
}
}catch(  Exception  e  ){
Log.e("dd",  "Error  in  network  call"+  e);
}
}