Showing posts with label RSS. Show all posts
Showing posts with label RSS. Show all posts

7.5.09

little win

After a morning of trying to break HTML requests into strings and then into individual words, I have decided to abandon the BBC RSS feed and instead go with yahoo's less regularly updated one. Because the XML of the yahoo RSS feed looks like this:



Instead of the state of the weather being addressed in the description tag, almost each attribute of the weather is addressed in it's own little tag. Which makes it a lot easier to work with! It's what mister shiffman used in his script as well, so there's some documentation of how to use it well.

dirty XML

I've decided to look again at mister shiffmans simpleML library again, which I looked at briefly in my twitter top project, and found that not only am I a complete berk for not spotting the re-request HTML/XML command which I wanted so desperately and caused me annoyance when I couldn't figure it out myself, but that although it will save my program looking through the whole document, and therefore speed it up, it might still be not as useful as I'd like.

here's the BBC RSS feed for Leeds at the moment:



here's the bit that I'm interested in:



(Temperature: 9°C (48°F), Wind Direction: SW, Wind Speed: 40mph, Relative Humidity: 66%, Pressure: 987mB, rising, Visibility: Good)

Unfortunately, all the juicy bit I'm interested in is all in the same XML tag, so I can't use simpleML to all it's useful yummyness.

This causes a little problem with the words I'm using in my script. For example, "sunny" and "sunny intervals" both contain the word "sunny" so my script will see "sunny intervals" as "sunny". If that makes sense. The script I'm using at the moment is based on a script I used in my last project:


//pulling in feed of weather in stornoway

String[] tokens; //array
int counter;

void setup() {
size(100, 100);


//load file and split up words
String[] lines = loadStrings("http://news.bbc.co.uk/weather/forecast/373/ObservationsRSS.rss");
String allText = join(lines, " ");
tokens = splitTokens(allText, " ,.?!:;[]-");

}

//so it's now pulling in that sentence and splitting it up.

void draw() {
background(255);
fill(0);

String s = tokens[counter];
counter = (counter +1) % tokens.length;
//look at the words one at a time please



//is the word there?

if (s.equals("sunny")) {
println("sunny");
noLoop(); //DON'T LOOP IT BAHBEE.

}

if (s.equals("white")) {
println("white cloud");
noLoop(); //DON'T LOOP IT BAHBEE.

}

if (s.equals("grey")) {
println("grey cloud");
noLoop(); //DON'T LOOP IT BAHBEE.

}

if (s.equals("light")) {
println("light rain");
noLoop(); //DON'T LOOP IT BAHBEE.

}

if (s.equals("heavy")) {
println("heavy rain");
noLoop(); //DON'T LOOP IT BAHBEE.

}

if (s.equals("clear")) {
println("clear sky (night)");
noLoop(); //DON'T LOOP IT BAHBEE.

}

}


Now i just need to simpleML it up.

1.5.09

weather feeds

I've been looking into what weather feeds to use, and found BBC backstage which lets you get access to lots of the BBC's APIs and feeds and such like. It turns out that you can easily get the feeds on the new weather pages anyway!

Here's what an RSS weather feed looks like:



It's actually quite descriptive, there's a description of the weather (sunny intervals, grey clouds or whatever), and temperature, wind direction, wind speed, relative humidity, pressure and visibility. I may not use humidity, pressure or visibility but will definitely use temperature and the wind data.

I've made some notes of the different weather descriptions, and since I'm only looking at the british isles so far it's all relatively similar. I may look into using worldwide data just so there's some variation in what weather the interface reports. If all britain has a really great or pap day in general, the data will be pretty much the same.

Now I just need to come up with some cute things that represent wind and sunny intervals.

13.11.08

stalking allemotional:

i've created a new twitter account, called allemotional, to use with my processing program. All it says at the moment is that it's happy, but as i test out more and more words it'll soon build up. I've also used yahoo pipes to create a RSS feed of the twitter feed that processing likes. It didn't like the twitter RSS very much.

I'm working on Liams mini mac, it's freaking tiny!!!

4.10.08

wearing data feeds - News Knitter

RSS feeds make lovely warm jumpers.



Using 24 hours of news data feeds, News Knitter makes the daily political news into a lovely snuggly jumper. One piece of software receives the data and another analyzes the feeds and makes them into different patterns. The final product is then produced on a fully computerized knitting machine.



I think this is a very nice example of how to take the internet off screen. Although some people wouldn't really think of this as a digital product as there's no circuits or programming on the actual finished product, the information used to create the pattern was gleamed from the internet, and software produced the patterns, making the jumper a product of the internet.