thats will be work...
public static int getHopZoneVotes()
{
int votes = -1;
try
{
final URL obj = new URL(Config.VOTES_SITE_HOPZONE_URL);
final HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.addRequestProperty("User-Agent", "L2Hopzone");
con.setConnectTimeout(5000);
final int responseCode = con.getResponseCode();
if (responseCode == 200)
{
try (BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())))
{
String line;
while ((line = in.readLine()) != null)
{
if (line.contains("Total Votes") || line.contains("rank tooltip") || line.contains("no steal make love") || line.contains("no votes here") || line.contains("bang, you don't have votes") || line.contains("la vita e bella") || line.contains("rank anonymous tooltip"))
{
String inputLine = line.split(">")[2].replace("</span", "");
votes = Integer.parseInt(inputLine);
break;
}
}
}
}
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("HOPZONE is offline. We will check reward as it will be online again.");
}
return votes;
}