0

Hi so im a complete noob with this but using some tutorials etc i have some code that will grab the data from the url and output it in the console separated by commas. I want to store these into an array so i can output one specific value later on. Many thanks

import java.net.*;
import java.io.*;

public class URLConnectionReader {
public static void main(String[] args) throws Exception {
    URL oracle = new URL("http://http://services.runescape.com/m=hiscore_oldschool/index_lite.ws?player=peckishwhale");
    URLConnection yc = oracle.openConnection();
    BufferedReader in = new BufferedReader(new InputStreamReader(
                                yc.getInputStream()));
    String inputLine;
    while ((inputLine = in.readLine()) != null) 
        System.out.println(inputLine);
    in.close();
}
}

The above code outputs the following

827,2111,227033174 18873,99,13149102 19093,99,13186202 2423,99,21576563 2625,99,27614813 882,99,23216231 8038,85,3258842 361,99,21122150 20817,98,12039891 10787,90,5600042 20728,94,8243999 8270,91,6089395 6168,80,1987711 2317,92,6781954 3745,86,3873930 3138,87,3987535 3997,89,5085564 2396,89,5040529 3028,91,5904457 4015,95,9290301 4062,91,6434300 2771,84,3122397 427,99,19085038 2850,76,1342228 72,792 2805,61 2805,274

Is this simple to do?

JackGalway
  • 21
  • 2

0 Answers0