package src;

import java.util.HashMap;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public class StatisticReader extends HTMLReader {
	private final static String IDEAS_STATS = "ideas-stats";
	private final static String OTHER_STATS = "other-stats";
	
	public StatisticReader() {
		super();
		prepareUserAgent();
	}
	
	public HashMap<String,String> getCommunityStatistic(String url)  
	{
		HashMap<String,String> statistics = new HashMap<String,String>();
		statistics.put("ideas", "unknown");
    	statistics.put("comments", "unknown");
    	statistics.put("votes", "unknown");
    	statistics.put("members", "unknown");
		
		String content;
		try {
			content = getUrlContent(url);
			 Document doc = Jsoup.parse(content);
		        
	        Element ideasStats = doc.getElementById(IDEAS_STATS).child(0);
	        if (ideasStats != null)
	        	statistics.put("ideas", ideasStats.text());
	        	
	        Elements otherStats = doc.getElementById(OTHER_STATS).children();
	        if (otherStats != null) {
	        	statistics.put("comments", otherStats.get(0).text());
	        	statistics.put("votes", otherStats.get(1).text());
	        	statistics.put("members", otherStats.get(2).text());
	        }
	        return statistics;
		} catch (Exception e) {
			System.out.println(e.getMessage());
			return statistics;
		}
       
        
        
	}
	
}

@@ -560,36 +560,33 @@
 s%22, %22unknown%22);%0A
-    
+%09
 %09statistics.put(
@@ -601,36 +601,33 @@
 s%22, %22unknown%22);%0A
-    
+%09
 %09statistics.put(
@@ -647,20 +647,17 @@
 nown%22);%0A
-    
+%09
 %09statist
@@ -752,17 +752,16 @@
 rl);%0A%09%09%09
- 
 Document
@@ -801,24 +801,18 @@
       %0A%09
-        
+%09%09
 Element 
@@ -863,32 +863,26 @@
 .child(0);%0A%09
-        
+%09%09
 if (ideasSta
@@ -894,25 +894,22 @@
  null)%0A%09
- 
+%09%09
     
-   %09
 statisti
@@ -924,16 +924,39 @@
 ideas%22, 
+replaceThounsandSymbol(
 ideasSta
@@ -957,32 +957,33 @@
 easStats.text())
+)
 ;%0A%09        %09%0A%09  
@@ -980,24 +980,18 @@
      %09%0A%09
-        
+%09%09
 Elements
@@ -1049,24 +1049,18 @@
 ren();%0A%09
-        
+%09%09
 if (othe
@@ -1077,26 +1077,23 @@
 null) %7B%0A
+%09%09
 %09    
-    %09
 statisti
@@ -1107,24 +1107,47 @@
 %22comments%22, 
+replaceThounsandSymbol(
 otherStats.g
@@ -1155,36 +1155,34 @@
 t(0).text())
+)
 ;%0A%09
-    
+%09%09
     
-%09
 statistics.p
@@ -1192,17 +1192,39 @@
 %22votes%22,
- 
+replaceThounsandSymbol(
 otherSta
@@ -1240,28 +1240,26 @@
 .text())
+)
 ;%0A%09
-    
+%09%09
     
-%09
 statisti
@@ -1276,16 +1276,39 @@
 mbers%22, 
+replaceThounsandSymbol(
 otherSta
@@ -1328,30 +1328,19 @@
 t())
+)
 ;%0A%09
-        %7D%0A%09        
+%09%09%7D%0A%09%09%09
 retu
@@ -1473,13 +1473,108 @@
      %0A%09%7D
+%0A%0A    private String replaceThounsandSymbol(String str) %7B%0A%09return str.replace(%22K%22,%22000%22);%0A    %7D
 %0A%09%0A%7D%0A

Add a statement to replace quote symbol with a blank space