import java.net.*; import java.io.*; public class TeateOtsing{ public static void main(String argumendid[]) throws IOException{ String aadress="http://maps.google.com/maps/geo?output=xml&q="+argumendid[0]; String volinikuaadress="cache.tlu.ee"; String volinikuvarat="3128"; System.getProperties().put("proxySet", "true"); System.getProperties().put("proxyHost", volinikuaadress); System.getProperties().put("proxyPort", volinikuvarat); BufferedReader sisse=new BufferedReader( new InputStreamReader(new URL(aadress).openStream()) ); String rida=sisse.readLine(); int algus=rida.indexOf(""); int ots=rida.indexOf(""); String abi=rida.substring(algus+13, ots); System.out.println(abi); String[] arvud=abi.split(","); aadress="http://search.twitter.com/search.atom?geocode="+arvud[1]+","+arvud[0]+",10km"; System.out.println(aadress); sisse=new BufferedReader( new InputStreamReader(new URL(aadress).openStream()) ); rida=sisse.readLine(); while(rida!=null){ algus=rida.indexOf(""); if(algus!=-1){ots=rida.indexOf("");} if(algus!=-1 && ots!=-1){ System.out.println(rida.substring(algus+7, ots)); } rida=sisse.readLine(); } } }