We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpProcessing Implementations › Sketch on a server via script (not in browser)
Page Index Toggle Pages: 1
Sketch on a server via script (not in browser) (Read 1518 times)
Sketch on a server via script (not in browser)
May 12th, 2009, 7:01am
 
You'll have to forgive my ignorance as to the basics of integrating the different server/web languages, being self taught there are just some things I haven't even taken a peak at yet.

Basically I've cobbled together a sketch that will login to a gmail account, download any new mail, parse the attachments, and then do what I like with them.  It was created at first to collect gps data I'm sending as a .gpx attachment from my iPhone (the GPS app is MotionX), and then to graph each new track and save off a revised image which would be displayed on my blog.  At first I was hoping to sit the java applet on my hosting and trigger it with each email.  That seemed a stretch so I was going to setup a cron job on the server to cause the sketch to sweep my GPS drop email every hour or so looking for new tracks.

My issue is, I'm not sure if I can create a java applet that can be executed on a server without being actually loaded into a browser.  The sketch draws no window, so it doesn't need to do anything but run.  A friend just suggested I export it as a linux app instead of a java applet and then sit that on the server.   It sounds like a good idea and that is where I'm headed, but any input from someone more knowledgeable is always appreciated.

I'll clean up the code on the email reader/write sketch and post it soon, its basically this code:

http://www.shiffman.net/2007/11/13/e-mail-processing/

modified to check to see if there is an email attachment and then to parse it and save it off (so far its designed to read xml only)

Thanks,
Duncan

Re: Sketch on a server via script (not in browser)
Reply #1 - May 12th, 2009, 9:32am
 
Well, at a quick glance, Daniel's code is 100% Java.
Processing isn't really designed to be headless (without display).
So I think your best move is to remove any Processing idiomatic code (ie. transform it to Java) if any, compile it with JavaC, pack it to a Jar file (if there are several classes, although it is not really necessary, just handy to move around) and run it as a regular Java application on your server.

PS.: Not sure why this thread is in Processing Implementations board...
Page Index Toggle Pages: 1