ArrayList<String> getGoldRanking(String query) {
		
		//int numResults = 100;
		ArrayList<String> gold;
		String queryTerms = query.replaceAll(" ", "+");
		try{
			FileInputStream streamIn = new FileInputStream(this.wikiDirectory +queryTerms +".ser");
			ObjectInputStream objectinputstream = new ObjectInputStream(streamIn);
			gold = (ArrayList<String>) objectinputstream.readObject();
			return gold;
		}catch(Exception ex){}

		gold = new ArrayList<String>();
		String url = "http://de.wikipedia.org/w/index.php?title=Spezial%3ASuche&search=" +queryTerms +"&fulltext=Search&profile=default";
		String wikipage = "";	
		try {
			wikipage = (String) new WebFile(url).getContent();
		} catch (SocketTimeoutException e) {
			e.printStackTrace();
		} catch (UnknownServiceException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		String[] lines = wikipage.split("\n");
		for(int i=0;i<lines.length;i++){
			//if(lines[i].startsWith("<li><div class='mw-search-results-heading'>")){
			if(lines[i].startsWith("<li>")){
				Pattern p = Pattern.compile("title=\"(.*)\"");
				Matcher m = p.matcher(lines[i]);
				m.find();
				gold.add(m.group(1));
				
				//debug
				//System.out.println("m.group(1): " + m.group(1));
			}
		}		
		try {
			FileOutputStream fout = new FileOutputStream(this.wikiDirectory +queryTerms +".ser");
			ObjectOutputStream oos = new ObjectOutputStream(fout);
			oos.writeObject(gold);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		//debug
		//System.out.println("gold return: " + gold);
		
		return gold;
	}