Is this possible at all (spreadsheets/html)

Permabanned
Joined
22 Aug 2004
Posts
9,204
i need to create a league table that updates from a freely available online table (its essentially a football stats table) applys custom calculations to the figures and then resorts the table by these new figures?

Case in point

Lets take 3 table entries

team home
W D L
Chelsea 9 2 2
man u 9 1 3
arsenal 8 2 3


etc

the table would then multiply the draws by 0.5 invert the losses into negatives and add W + D + L then sort itself by the result.

Possible?
 
I'm pretty sure it would be possibly (although not entirely sure how), but instead of creating a web page. You might be easier signing up for a Google Docs account then create the spreadsheet online and you can share the spreadsheet with only a select group or the entire internet.

docs.google.com
 
A simple program could obtain the data, process it and then put it into a text/html/speadsheet file.

Something like this.

Code:
import java.net.*;
import java.io.*;

public class LeagueTableGenerator {
    public LeagueTableGenerator() {
        getData();
    }

    public void getData() {
	try {
            URL url = new URL("LeaguesWebsiteURL");
            URLConnection connection = url.openConnection();
            connection.connect();
            InputStream in = connection.getInputStream();
            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
            String leagueData;
            while ((leagueData = reader.readLine()) != null) {
                processData(leagueData);
            }
	} catch (Exception e) {}
    }
    
    public void processData(String leagueData) {
        //manipulate league data
        outputData(leagueData);
    }
    
    public void outputData(String leagueData) {
        FileOutputStream fos = new FileOutputStream("LeagueData.xls", true);
	fos.write(leagueData);
	fos.close();
    }
    
    public static void main(String[] args) {
        new LeagueTableGenerator();
    }
}
 
Last edited:
Back
Top Bottom