hi there
im just starting to use yahoo Api's and
i would want to know if is possible todo
maps search in java.
i've tried use a url class
but the search result is a strange string
my SimpleSearch.java is:
String request = "http://api.maps.yahoo.com/ajaxymap?v=3.8&appid" +
"=SmP9SJrV34EKTzI3NyOZnM5EzWrd0Q4zl5gEE60GXeWpiPQt" +
"unuNvgIwY9fVkFTMytJn4zEXgyU-";
try {
URL url = new URL(request);
InputStream in = url.openStream();
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
for (int i = 0; i < len; i++) {
System.out.print((char)buf[i]);
}
}
in.close();
}
the results is:
var YAHOO=window.YAHOO||{};
YAHOO.namespace=function(_1){
if(!_1||!_1.length){
return null;
}
var _2=_1.split(".");
var _3=YAHOO;
for(var i=(_2[0]=="YAHOO")?1:0;i<_2.length;++i){
_3[_2[i]]=_3[_2[i]]||{};
_3=_3[_2[i]];
}
return _3;
};
YAHOO.namespace("util");
YAHOO.namespace("widget");
YAHOO.namespace("example");
var YMAPPID =
"SmP9SJrV34EKTzI3NyOZnM5EzWrd0Q4zl5gEE60GXeWpiPQtunuNvgIwY9fVkFTMytJn4zEXgyU-";
function _ywjs(inc) { var o='<'+'script src="'+inc+'"'+'
type="text/javascript"><'+'/script>'; document.write(o);
}_ywjs('http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/dom_2.0.1-b2.js\
');
_ywjs('http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/event_2.0.0-b2.j\
s');
_ywjs('http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/dragdrop_2.0.1-b\
4.js');
_ywjs('http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/animation_2.0.1-\
b2.js');
_ywjs('http://us.js2.yimg.com/us.js.yimg.com/lib/map/js/api/ymapapi_3_8_0_7.js')\
;<!--
xm5.maps.re3.yahoo.com uncompressed/chunked Thu Oct 23 08:13:15 PDT
2008 -->
i'll be really grateful if you can help me
thanks