All pastes #624677 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-07-18 13:21 UTC
rendered paste body
package com.cp.rusrs;

import java.net.URLConnection;
import java.net.URL;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

/**
 * Date: Jul 17, 2007
 * Time: 7:41:32 PM
 * Author: Aftermath
 */
public class SSLeecher {
    public static void main(String[] args) {
        List<String> h = new ArrayList<String>();
        try {
            URLConnection a = new URL("http://www.moparscape.org/serverstatus.php").openConnection();
            a.setRequestProperty("User-agent", "Mozilla");
            BufferedReader b = new BufferedReader(new InputStreamReader(a.getInputStream()));
            
            String c;
            while((c = b.readLine()) != null) {
                if(c.contains("/?server=")) {
                    int g = c.indexOf("&amp;");
                    String e = c.substring(c.indexOf("server=") + 7, g);
                    int f = Integer.parseInt(c.substring(c.indexOf("port=") + 5, c.indexOf("&amp;", g + 1)));
                    h.add(e + ":" + f);
                }
            }
            System.out.println(h.size() + ":" + h);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}