import processing.net.*;
Server fsSrv;
XMLElement flickrXML;
XMLElement picList;
PFont myFont;
String lastMsg="";
void setup(){
size(600,300);
fsSrv=new Server(this, 8180);
flickrXML=new XMLElement(this, "http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=02c70258816eb611b3047fc9f28b1f8a&photoset_id=72157594290642861");
XMLElement pics=flickrXML.getChild(0);
picList=new XMLElement("");
int totalPics=4;
int xp=-400;
int yp=0;
for(int i=0; i399){
xp=0;
yp+=400;
}else{
xp+=400;
}
picList.addChild(new XMLElement(""));
}
myFont=createFont("Arial",16);
textFont(myFont);
}
void draw(){
background(0);
text("ok",10,20);
Client client = fsSrv.available();
if(client != null){
lastMsg = client.readString();
if(lastMsg != null){
fsSrv.write(""+lastMsg+"");
}
}
text(lastMsg,30,20);
}
void serverEvent(Server srv, Client clt){
fsSrv.write(picList.toString());
}