PFont f; XMLElement xml; int t = -150; int wid; int L; color r = color(200, 0, 100); color d = color(0, 0, 255); PImage b; String[] url = new String[60]; String[] author = new String[60]; String[] name = new String[60]; int q = 0; String nm; String aut; void setup() { size(300,300); smooth(); f = loadFont("SansSerif-12.vlw"); textFont(f,14); noStroke(); textAlign(CENTER); getUploads(); } void draw(){ background(0); getUploads(); } void getUploads(){ xml = new XMLElement(this, "http://www.thevioletpiece.com/spore/proxy/stats.php"); String uploads = xml.getChild("totalUploads").getContent(); textAlign(CENTER); int len = uploads.length(); int ons = Integer.parseInt(uploads.substring(len-1, len)); int tns = Integer.parseInt(uploads.substring(len-2, len-1)); int tens = Integer.parseInt(uploads.substring(len-2, len)); int thous = Integer.parseInt(uploads.substring(len-3, len-2)); int tthous = Integer.parseInt(uploads.substring(len-4, len-3)); int hthous = Integer.parseInt(uploads.substring(len-5, len-4)); int mil = Integer.parseInt(uploads.substring(len-6, len-5)); int tmil = Integer.parseInt(uploads.substring(len-7, len-6)); int hmil = Integer.parseInt(uploads.substring(len-8, len-7)); stroke(1); color c4 = color(0,250,120); color c3 = color(255,0,120); color c2 = color(125,0,250); color c1 = color(0,125,250); color c = color(0,0,250); makePie(225,200, hmil, 10, 150, 150, PI/2, c1); makePie(200,175, tmil, 10, 150, 150, PI/2, c3); makePie(175,150, mil, 10, 150, 150, PI/2, c4); makePie(150,125, hthous, 10, 150, 150, PI/2, c2); makePie(125,100, tthous, 10, 150, 150, PI/2, c3); makePie(100,75, thous, 10, 150, 150, PI/2, c1); makePie(75,50, tens, 100, 150, 150, PI/2, c4); fill(255); text(Integer.toString(hmil), 155, 150-200/2); text(Integer.toString(tmil), 155, 150-175/2); text(Integer.toString(mil), 155, 150-150/2); text(Integer.toString(hthous), 155, 150-125/2); text(Integer.toString(tthous), 155, 150-100/2); text(Integer.toString(thous), 155, 150-75/2); text(Integer.toString(tns), 155, 150-50/2); text(Integer.toString(ons), 155, 150-25/2); } void makePie(int ro, int ri, int valu, int mx, int x, int y, float rot, color q) { fill(q); arc(x, y, ro, ro,-rot, 2*PI*(valu)/mx- rot); fill(0); ellipse(x, y, ri, ri); }