Web scrape in processing

processingNumberScrape.m4v from chris martin on Vimeo.

The web is just full of data that ebbs an flows and it is quite nice to have a technique to scrape this off the web into some code. This is scraping the wind speed in dundee into processing. You could then use serial to fire this down to arduino the possibilities are limited only by you imagination (and money and time). This is really bare bones but should get you started with chopping up html in processing and getting to live data.


String[] ln = loadStrings("http://www.windfinder.com/report/dundee");
String page = "";
for (int i=0;i<ln.length;i++) {
 // println(i+"] "+ln[i]);
  page+=ln[i];
}
String[] bits = split(page, "");
bits = split(bits[1],"");
println(bits[0]);
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s