int good = 0; int bad = 0; PFont font; PImage dove; PImage skull; String date; char d; void setup(){ size(500,500); //dove = loadImage("DOVE.jpg"); //skull = loadImage("KABOOM.jpg"); ///////////////////////////////////////////////////////////////////////////////////////////////conversion strings String url = "http://www.nytimes.com";//loads string into proc data file //this is the permanent address for Shawn's php proxy String proxy = "XXXXX eyes only XXXXX"; // String[] html = loadStrings(myURL); //loads html string into proc envrmnt String[] html = loadStrings(proxy + url); // String[] html = {"date\">","nuclear","nuclear","<"};//debug String news = join(html, ""); // streems html into one string news = news.toLowerCase(); // transfers text to lower case //enter whatever URL you want to load // String url = "http://www.nytimes.com"; //put the two together and load /////////////////////////////////////////////////////////////////////////////////////////////// information strings //print current day///////////////////////////////////////////////////// //div id="date">Sunday, October 8, 2006 ") + 6; int end = news.indexOf("<",start); String date = news.substring(start,end); /////////////////////////////////peacefind String list[] =(splitTokens(news, ".<>//-= " )); // defines breaks // println (list.length); for (int i = 0; i < list.length; i++) { // calls through array list for all array spaces String str1 = list[i] ; String str2 = "peace"; String str3 = "nuclear"; // println (list[i]); // prints to serial port if(str1.equals(str2) == true) { // println("heellllllooooooo nurse"); // They are equal so this line will print good = good + 1; } else { // println("Not equal"); } if(str1.equals(str3) == true) { // println("hellllllooooooo nurse"); // if hey are equal so this line will print bad = bad + 1; } else { // println("Not equal"); } } // println(good); //print number for words // println(bad); // println (date); font = loadFont("TimesNewRomanPSMT-48.vlw"); if (good > bad){background (0);} // compares the number of words good bad sets background acord else if (good == bad){ background (125);} else {background(255);} fill(200,0,0); // fills text textFont(font, 28); // prints current date text(date, 120, 50); //draw shapes////////////// smooth(); noStroke(); fill(255); ellipse (250,150,80,80); textFont(font, 18); text("WORLD PEACE",190,220); //////triangle////////////////////////////////////// strokeWeight(3); fill(0); triangle(200, 400, 250, 300, 300, 400); textFont(font, 18); text("NUCLEAR WINTER",175,420); // image(dove, 150, 150,90,80); // tint(255); // image(skull, 150, 300,120,80); } ////////////////////////////////////////end setup///////////////////////////////////